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

getting a value from the results of an append query

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
Hi there, I have created an append query that appends to a particular table. What I would like to do is get the unique id that was assigned for that new record so that I can enter it into another linked table. Is there a way to do this programmically? Thanks Dawn
 

Is the unique ID an Identity column? Which version of Access are you running?

Have you tried the DMax domain function?

varID = DMax("[ID]","Table")

ID represents the UniqueID column and table represents the append table. Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
Thanks Terry...I am in Access 2000. And I am not totally sure of what you mean by identity column. I think you mean is it the primary key? If so, yes. It is an autonumber generated when the record is appended and is the primary key for the table. I am assuming that DMax will give me the highest number in that field, which would be the record just appended. Am I right? Thanks a bunch. Dawn
 

Dawn,

I should have said Autonumber rather than Identity in Access. I apologize for the confusion. DMax does return the maximum or highest number in the column. Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top