We have a maintenance database that keeps track of work orders, pieces of equipment, job instructions, and so forth. On the Equipment form, you can view another form that shows the schedule for that piece of equipment. From this form, you can generate work orders for that one piece of equipment. This works fine. I have another form that is called Scheduled Work Orders. In this form, I can chose a date range....for instance, show me all the scheduled work orders for next week. This brings up a list of the scheduled pieces of equipment. The work orders have not been created yet. When I press the "Generate Work Orders" button, it runs a series of queries to generate all the listed work orders. Previously, I had the Work Order number field in my work order table as an autonumber field, and this worked like a charm. However, because of a flaw in the autonumber type (leaving gaps when records are deleted), I have changed the work order number field to just a numeric field that will be incremented sequentially. This is easy to do in VBA code, but in a query, this is where I run into the problem. What I need the query to do is take the last work order number and increment it sequentially for each record present in the query.
Wow........that is confusing.