need help with NewRecord expression

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I am creating a form where users enter new records that relate to the field
[JobNumber]. I am wondering how to write an expression or code that will add
1 to the New Record in the field [PunchID]. It would be sort of like an
AutoNumber, but each JobNumber would start with "001". Here is an example:

JobNumber PunchID
065555 001
065555 002
065555 003
- new record would default to 004
065577 001
065577 002
- new record would default to 003
...and so on...

JobNumber is the one side of a one-to-many relationship with PunchID.
Thank you in advance for any help!
 
G

Guest

NewPunch = Nz(DMax("[PunchID]", "MyTableName", "[JobNumber] = '" &
Me.txtJobNumber & "'"),0) + 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top