Tim
|
Posted: 12/19/2003, 1:15 PM |
|
HELP!!! I can't seem to get this Dlookup to pass a variable to the command. Here is what I have and the error I am getting, I am using ASP and Access Database.
Dim Equimpent
Equimpent = SpareParts_with_LocationSearch.s_EQUIP_NO.value
SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO = " & Equimpent,DBConnection1))
Source: CCDLookUp function
Command Text: SELECT EQUIP_NO FROM [SPAREPARTS WITH LOCATION] WHERE EQUIP_NO = pm-001
Error description: No value given for one or more required parameters. (Microsoft JET Database Engine)
It is passing the variable to the Select statement but is is not finding any data, If I just put in "EQUIP_NO = 'PM-001'" it will work. How do I have to code this so it sees it right.
|
|
|
Edd
|
Posted: 12/20/2003, 5:37 PM |
|
You forgot the single quotes around equipment , ie
SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO = " & Equimpent,DBConnection1))
Should be
SpareParts_with_LocationSearch.TextBox1.Value = CStr(CCDLookUp("EQUIP_NO","[SPAREPARTS WITH LOCATION]","EQUIP_NO='" & Equimpent & "'",DBConnection1))
In the words of that great philosopher Homer - Doh!
Edd
|
|
|
Tim
|
Posted: 12/20/2003, 6:47 PM |
|
DOH...
Thanks for you help.
Tim
|
|
|
|