View Single Post
  #2  
Old November 7th, 2009, 09:21 PM posted to microsoft.public.access.tablesdbdesign
Ken Snell
external usenet poster
 
Posts: 177
Default Need a little help with syntax

Your code appears to be syntactically correct, assuming that [Transaction
Type] field is numeric data type.

--

Ken Snell
http://www.accessmvp.com/KDSnell/


"plisvb via AccessMonster.com" u55912@uwe wrote in message
news:9ec4e5eceaf26@uwe...
Hi Guys,

Having a little problem with some code. I'm wondering if anyone with a
keen
eye can point out my error.

Private Sub Transaction_Type_AfterUpdate()
If Me.NewRecord Then
Me.invID = Nz(DMax("[OrderID]", "Orders", "[Transaction Type] = 2"), 0)
+
1
End If
End Sub

I want the text field invID to update once a transaction type is selected.

The field updates but not the way I need it too. I want it to show the
highest number with a transaction type of 2(outgoing) and then add 1 to it
to
create a sequence for outgoing orders. It's updating, but it's just
showing
me the highest number of ALL invoices regardless of transaction type.

Thanks in advance

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200911/1