Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incrementing with Dmax

Status
Not open for further replies.

bobbster2000

Programmer
Sep 19, 2001
102
US
In Access for Windows XP, I have a table called "Work Order". It has a field called "Job #" in which I need a way to enable the users to enter a Suffix attacted to "Job #" in Some cases. For example, if one user gets the "Job #" 25 but there's 3 parts to it. He'll need to add a suffix so we'll have 25a, 25b, 25c, three seprate records, but related. The "Job #" needs to be Auto Generated so I'm using the Dmax function but my VB skills are very poor. I need to have "Job #" be incremented by one with using the Dmax function but I keep on getting errors. Here's the code

Private Sub Form_BeforeInsert(Cancel As Integer)

JOB # = DMax("JOB #", "Work Order") + 1

End Sub


It tells me that (Identifer under cursor not reckonized) and the cursor is pointing to the Private Sub section.

Can anyone please assist?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top