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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DMax 1

Status
Not open for further replies.

BabyPowder2u

Programmer
May 4, 2005
87
US
I am trying to get the next sequence number for a tracking number.
The number is composed of 3 parts YY (year) XX (two set characters and nnnn (a 4 digit number): yyXXnnn

I am using:

ASeq = DMax("Right([TrkNumber], 4)", "[tblRequest]", "Left([TrkNumber], 2)='" & Format(Date, "yy") & "'")

this works fine, if there is a number already in the file, however I need to set the value to 0001 if this returns a null (no value found).

Can someone help me modify this please.

T
 
Have a look at the Nz function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top