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

Assigning numbers to a field 1

Status
Not open for further replies.

jgarnick

Programmer
Feb 16, 2000
189
US
I need to have the user type in a year, ie 1999 and then click a button (?) that will auto assign the next available number for that year and then drop it in a field like this-- 1999.01&nbsp;&nbsp;.&nbsp;&nbsp;Then the next 1999 item would have 1999.02 assigned to it and so on.&nbsp;&nbsp;I'll need to track numbers for a number of years, anywhere from 20 to 50 years worth since the entries will bounce from different year to year.&nbsp;&nbsp;What's the best way to do this? <p>jgarnick<br><a href=mailto:jgarnick@aol.com>jgarnick@aol.com</a><br><a href= > </a><br>
 
One possible solution might be to use two separate fields (i.e. fldYear, fldNo) then you could use a query with the totals turned on, Group on fldYear and MAX on fldNo. You would capture this data and if fldNo is a numeric field then you would just add 1 to it. Then when you wanted to display the data use an expression (i.e. fldYear & &quot;.&quot; & format(cstr(fldNo,&quot;00&quot;)).<br><br>Just one possible way.<br><br>PaulF
 
Thanks!! It worked perfectly! <p>jgarnick<br><a href=mailto:jgarnick@aol.com>jgarnick@aol.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top