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

Append Query on Autonumber Field

Status
Not open for further replies.

Penrodcigar

Technical User
Aug 23, 2006
19
US
Is it possible to use an append query SQL statement with DoCMD.RunSQL when updating a table that has an Autonumber ID field? I keep getting a key violation. It's no problem without the Autonumber field.
 
AutoNumber is just that - automatically generated. Therefore, including the field name in the APPEND statement is in error.
 
How are ya Penrodcigar . . .

[ol][li]For an [blue]Append[/blue] query append any field(s) you like except the autonumber, access will take care of this.[/li]
[li]For an [blue]Update[/blue] query use criteria to zero in on the autonumbered record to update.[/li][/ol]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Well, I'm not sure what was the matter, but I finally worked it out. Maybe it was the update/append dichotomy. Actually I just found a work around instead of writing a new temporary table I made a form dialogue box with its record source as the table that needed updating.

Regards,
Peter Landeck
 
>>>use an append query SQL statement with DoCMD.RunSQL when updating a table

Your original statement of the problem is unclear as to whether you are attempting to add or edit records.

Append = Add
Update = Edit

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top