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

automatic step of tracking number

Status
Not open for further replies.

Ali29J

Technical User
May 13, 2004
203
GB
Hi All

I have a database form which uses a tracking number RFQ, which is in the format xxxxx-x, these numbers are sequentual, at present we have to track manually and enter manually.

I wanted to know if it is possible to step automatically based on the highest value previously entered, however it has the -x extension which should always remain at -0 unless altered manually, for example:

1) 10001-0 latest entry
2) looks up previous entry above and then enters next available i.e 10002-0
10003-0
10004-0
10005-0
and so on

is this possible at all...using code?

Ali

 
Yes. You need DMax:

[tt]Dmax("Left(RFQ,Len(RFQ)-2)","tblTable")+1 & "-0"[/tt]
 
Hi

I tried your code its saying "expected =" an high lights + sign not fanilia with how tis works so could do with a little assistance...

Ali
 
I think that you want this value to come up for new records, so the best thing to do is set the Default Value of the control bound to RFQ to the line of code above (that is, the control that has RFQ in it in design view). You will need to change tblTable to the name of the table that has RFQ in it. There may be problems with this method if you have serveral people adding records at the same time.
 
ah ok thanks Remou that seems to work perfectly....i have other safe guard which checks for duplicates before allowing entry which should protect against duplication
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top