I need to move to a specific record in a recordset using the primary key of the table, (2 fields)based on values that I have extracted from a form. I have tried to use the SEEK, FIND and FILTER methods on the recordset object, but none of them seem to allow the use of variables.
Here is an example of the code I am trying to use.
dim intvar1 as integer (item# from form -user entered)
dim intvar2 as integer (customer# from form -user entered)
dim cnn as adodb.connection
dim rcdset as new adodb.recordset
set cnn = currentproject.connection
rcdset.open ("TableName", cnn , adopenkeyset, adlockoptimistic, adcmdtabledirect)
rcdset.??????
I could make this work if I used a constant value instead of the variable.
eg: rcdset.find "[field]=12 and [field2]=30"
rcdset![Balance]="expression"
rcdset.update
but I need to replace the numeric values with the variable names
I hope I haven't been too vague with the description of my problem. I am fairly new at this, and I don't have that much experience with VBA.
Thanks for the help
Duane Barker
Here is an example of the code I am trying to use.
dim intvar1 as integer (item# from form -user entered)
dim intvar2 as integer (customer# from form -user entered)
dim cnn as adodb.connection
dim rcdset as new adodb.recordset
set cnn = currentproject.connection
rcdset.open ("TableName", cnn , adopenkeyset, adlockoptimistic, adcmdtabledirect)
rcdset.??????
I could make this work if I used a constant value instead of the variable.
eg: rcdset.find "[field]=12 and [field2]=30"
rcdset![Balance]="expression"
rcdset.update
but I need to replace the numeric values with the variable names
I hope I haven't been too vague with the description of my problem. I am fairly new at this, and I don't have that much experience with VBA.
Thanks for the help
Duane Barker