Queries are strictly for retrieval, not entry (I've always used them for
retrieval). I use forms for data entry (unless you are using a query as a
record source).
If you create a form for data entry,
Open the form in design view,
right click on the appropriate box, choose "properties" -> "events"
In the "before insert" event choose "event procedure"
Click on the "..."
Inser the following line into the procedure and change the field and table
names.
Me!RecordID = DMax("[FIELDNAME]", "[TABLENAME]") + 10
Save and exit
I suggest for the first record you manually enter the first ID and then
disable it (go to "properties" -> "data" and change "enabled" to "no"). When
you create a new record and enter information into another field, the new ID
number will be inserted automatically (the database will look for the highest
number and then add 10)
It should work. Let me know
ChuckW said:
Thanks for your help. I am a novice access user and am trying to figure out
how to do this. I this done through a query? I am used to doing queries in
design mode and sometimes going in and modifying the sql in the sql viewer
code. Can you give me a few steps on where to start with this process?
Thanks,
--
Chuck W
scubadiver said:
Put the following code in the "before insert" event. "RecordID" is the field
and "tble_hrs" is (obviously) the table!
Me!RecordID = DMax("[RecordID]", "[tble_hrs]") + 1
Hope it helps
ChuckW said:
Hi,
I want to create an autonumber field but have it go in groups of 10 such as
41770, 41780, 41790 etc rather than one number right after another. It woul
also be fine to create a field that isn't autonumber but automatically goes
up by 10 every time there is a new record created. Can someone help?
Thanks,