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

Save record in ODBC linked table

Status
Not open for further replies.

hennep

Programmer
Dec 10, 2000
429
I have a problem in an Access 2k application with linked tables in a sql-server 7 database.
In a form I create a new record in the linked table, when I save the record using this code: DoCmd.RunCommand acCmdSaveRecord the last record (another record) in the table is shown and the newly created record is saved as recordno 215 (ALWAYS 215 !!!).
Only after executing "Me.Requery" the new record is moved to the end of the table.

To reproduce this problem create a table in access 2000 with an autonumber field and a text field, the autonumber field is the primary key.
Add at least 215 records to this table and export this table to sql server.

All help is appreciated, I do not have a clue how to solve this.
 
Try this:
Remove your table and then add it back
but instead of just picking one key field pick 2 or more.
In my case I have to pick "Order number" and "part number"
since thare are several order numbers the same with different part numbers it can't distingush between them.
In some cases I needed as many as 4 key fields


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
do you really think the autonumber field is not enough ?
it should be unique.

but why does the save action leave the record when using an odbc linked table. It works correct if the linked table is in another access database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top