I have a SubForm that I am trying to use DMax to automatically generate multple consecutive locationNumbers on the SubForm for each OrderNumber on the MainForm.
Private Sub Form_BeforeInsert(CANCEL As Integer)
Me.LocationNumber = DMax("[LocationNumber]", "TBLLocations", "[OrderNumber] =" & [OrderNumber]) + 1
End Sub
I keep getting an invalid syntax error...where does it appear I am going wrong on this.
Private Sub Form_BeforeInsert(CANCEL As Integer)
Me.LocationNumber = DMax("[LocationNumber]", "TBLLocations", "[OrderNumber] =" & [OrderNumber]) + 1
End Sub
I keep getting an invalid syntax error...where does it appear I am going wrong on this.