Still new to this site and VBA, but found this post which handles a problem similar to mine
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=52918&highlight=increment
Here's the code for my application, but my output is zilch!
Background: I have a main form with drawing information and a subform with revision numbers. The two forms are linked on a field called TabOn. My supporting table looks something like
TabOnA rev1
TabOnA rev2
TabOnA rev3
TabOnB rev1
TabOnC rev1
I tried a variation of the code above but DMax returned the highest incremented value of all the TabOn's (rev4) not the intended result...for example, rev2 for TabOnC.
Thanks in advance
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=52918&highlight=increment
Here's the code for my application, but my output is zilch!
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.RevisionNumber = DMax("[RevisionNumber]", "tbl_TitleBlockEngineeringChanges", _
"tabon = '" & Me.TabOn & "'") + 1
End Sub
Background: I have a main form with drawing information and a subform with revision numbers. The two forms are linked on a field called TabOn. My supporting table looks something like
TabOnA rev1
TabOnA rev2
TabOnA rev3
TabOnB rev1
TabOnC rev1
I tried a variation of the code above but DMax returned the highest incremented value of all the TabOn's (rev4) not the intended result...for example, rev2 for TabOnC.
Thanks in advance
