I have Me!fields from a form that im adding to diffrent tables. I want to be able to look up a Me!techname in the technician table and find its corresponding tech_id number(primarykey) and write that primary key to a diffrent table Tech status
-table is technician
-primary key field is tech_id
-other field is techname
.Open "techstatus", CurConn, , , adCmdTableDirect
.AddNew
![serial_no_] = (Me!serial_no_)
![number] = (Me!number)
Dim varX As Variant
varX = (DLookup("[technician]", "Technician", "[tech_id] = " _& Forms!hotswapevent!lm_updated_by_lastname))
.Update
.Close
Any help would be greatly appreciated...Or another method suggestion if d lookup is not suitable..The error im getting on the way it is set up now is
-Run time error 2001
You cancelled the previous operation
-errors out on the dlookup line
-table is technician
-primary key field is tech_id
-other field is techname
.Open "techstatus", CurConn, , , adCmdTableDirect
.AddNew
![serial_no_] = (Me!serial_no_)
![number] = (Me!number)
Dim varX As Variant
varX = (DLookup("[technician]", "Technician", "[tech_id] = " _& Forms!hotswapevent!lm_updated_by_lastname))
.Update
.Close
Any help would be greatly appreciated...Or another method suggestion if d lookup is not suitable..The error im getting on the way it is set up now is
-Run time error 2001
You cancelled the previous operation
-errors out on the dlookup line