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!

Insert Into 1

Status
Not open for further replies.

andzejek

MIS
Sep 1, 2007
154
US
I'm adding record to the table which has automatically numbered field: cust_id. How can I find whot number is in this field of just inserted record. Code

SQLstr = "Insert into customer ([f_name],[l_name]) Values('" & str_F_Name & "','" & str_L_Name & "');"

CurrentDb.Execute SQLstr

cust_id=?

Andrew
 
Can you use DLookup for the number with the names as parameters?

Silence is golden.
Duct tape is silver.
 
Names can duplicate. Only unique field in this table is cust_id.
 
. . . and how about:
Code:
[blue]   Dim ID
   
   ID = DMax("[cust_id]", "TableName")[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top