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

autonumber not numbering new entries 1

Status
Not open for further replies.

Faded

Programmer
Feb 6, 2002
78
CA
Hi there,

I have an Access form that is used to enter new records into a database. The primary key for the new record is an autonumber and is visible on the form. While I am entering new data in textboxes etc. the pk textbox stays (autonumber) without turning into an actual number. When I save the new information, all of the information is sent to appropriate places in the database except the pk is left blank. How do I get Access to give the pk the next number and save it for that record?

Thanks,
Faded
 
Just a few things I can think of off the top of my head...

1. Check to make sure your form is properly bound to the table. (form control source = table name)
2. Check the tab order for the form. If the autonumber is last, and you click save (or whaetever) before the number is not assigned. (I would set the tab order number to zero and then set the TabStop Property to No. This will make the Autonumber field first in the tab order, but the cursor will be in the next field when the form is opened or focus is changed.
3. Check your table. Did you add the autonumber field after the table had data in it??? This can cause problems. if so, create a new table, identical to you curent one, and then use an append query to move the current records there. Delete the old one and then rename the new one. MAKE A BACKUP OF YOUR DATABASE FIRST!!!!!
4. Check the form to see if the AllowAdditions property is set to yes. Gotta have this to make new records. ANd along that same lines, if the form is ONLY for entering new records, set the DataEntry property to yes. This will filter out all the existing records when yuo open it, making for a faster load and process time.
5. Check the form Recordset property and make sure it is not Snapshot. Snapshot is not an actively editable recordset.

I'll try to come up with more if none of these work.....
There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top