D
dave
I have an ADODB recordset with a multiple field key:
ProNumber is one key field
ProNum is the second field in the key.
Both are numeric and defined as Single.
HoldProNumber holds the number of the first key field.
HoldProNum hold the number of the second key field.
HoldProNumber and HoldProNum are VBA defined numeric as
Single. Their numbers are derived from a list box located
on a different form. The numbers are saved into these two
Public variables and carried to the On Load event of the
new form. No problem. Now I need to retrieve the actual
record from the table "tblPickup", display the record in
my new form and be able to make changes to the data.
Your help in using the find method for multiple field keys
was:
rst.find "[pronumber] = '" & HoldProNumber & "' AND_
[ProNum] = '" & HoldProNum & "'"
This (you wrote) assumes that: ProNumber and ProNum are
Text datatype fields; if they're numeric leave off the '
in the string; and that you have VBA variables named
HoldProNumber and HoldProNum (i.e. leave off the
brackets). If the latter are form controls use Me!
[HoldProNumber} and me![HoldProNum].
I have tried the syntax exactly as written. I have also
tried it as:
rst.Find "[pronumber] = " & HoldProNumber & " _
AND [ProNum} = " & HoldProNum & ""
My open statement for the recordset is:
rst.open "tblPickup", cnn, adOpenDynamic, adLockOptimistic
Any Additional help will be greatly appreciated.
I have programmed for 30 years in COBOL, and it may be
that I'm too close to the problem and doing it the "old"
way to see where I'm going wrong.
The error message I get with either syntax is:
Run-Time Error '3001'
Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another.
Thanks again for your help.
Dave
ProNumber is one key field
ProNum is the second field in the key.
Both are numeric and defined as Single.
HoldProNumber holds the number of the first key field.
HoldProNum hold the number of the second key field.
HoldProNumber and HoldProNum are VBA defined numeric as
Single. Their numbers are derived from a list box located
on a different form. The numbers are saved into these two
Public variables and carried to the On Load event of the
new form. No problem. Now I need to retrieve the actual
record from the table "tblPickup", display the record in
my new form and be able to make changes to the data.
Your help in using the find method for multiple field keys
was:
rst.find "[pronumber] = '" & HoldProNumber & "' AND_
[ProNum] = '" & HoldProNum & "'"
This (you wrote) assumes that: ProNumber and ProNum are
Text datatype fields; if they're numeric leave off the '
in the string; and that you have VBA variables named
HoldProNumber and HoldProNum (i.e. leave off the
brackets). If the latter are form controls use Me!
[HoldProNumber} and me![HoldProNum].
I have tried the syntax exactly as written. I have also
tried it as:
rst.Find "[pronumber] = " & HoldProNumber & " _
AND [ProNum} = " & HoldProNum & ""
My open statement for the recordset is:
rst.open "tblPickup", cnn, adOpenDynamic, adLockOptimistic
Any Additional help will be greatly appreciated.
I have programmed for 30 years in COBOL, and it may be
that I'm too close to the problem and doing it the "old"
way to see where I'm going wrong.
The error message I get with either syntax is:
Run-Time Error '3001'
Arguments are of the wrong type, are out of acceptable
range, or are in conflict with one another.
Thanks again for your help.
Dave