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

Use last ClaimNum plus 1 in form field 1

Status
Not open for further replies.

explore

MIS
Aug 24, 2000
3
0
0
US
ClaimNum is a number assigned by the accounting department to each new claim. They use the next consecutive number. The form is based on a query. When the form is opened, I want the ClaimNum field to show the last ClaimNum that was used plus 1 then append that information and the other information entered on the form to the table. Any suggestions?
 
Assuming that the form is not bound to the data source (table/query) then the field where the claim number resides would have the control source set to =DMAX([ClAIM_NUMBER], [Your_table_name_here]) + 1

Write the claim number when the user commits the record to the database.

WARNING: this causes huge problems if it is a multiuser database. For example what if a person starts entering a claim number when another is half way through entering there claim. You may want to assign the claim number at the time of commitment or may I suggest you have a system table which is accessed by a bit of code that retrieves the next free claimnumber from this table and then writes the next available number to this table. When this table is being accessed, ensure that the table is locked (unavailable to all other calls) by this code until it is finished.

If this has been helpful, please mark this post as helpful. I would appreciate it immensely!

D.
 
see faq700-184 for an example of the technique described. It goes beyond the incrementing value, and is written for DAO, but includes the overall process you need.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top