View Single Post
  #1  
Old November 7th, 2009, 06:00 PM posted to microsoft.public.access.tablesdbdesign
plisvb via AccessMonster.com
external usenet poster
 
Posts: 13
Default Need a little help with syntax

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