Access MS Access DLookup

Joined
Jan 2, 2010
Messages
2
Reaction score
0
I have a Dlookup macro that fills in an Item Number when a product is chosen on a purchase order form. It works fine as long as the Item Number is only numbers. If there is a letter or other character in the product ID then I get the message:

"You tried to run a Visual Basic procedure to set a property or method for an object. However the component doesn't make the property or method available for automation operations."

Here is the current macro:

Item: [Forms]![Open POs]![PO Items]![PO Item Number]
Expression: =DLookUp("[Item Number]","[Enter Items]","[Item]=Forms![Open POs]![PO Items]![PO Item]")

Can anyone help?
 
If you are allowing alpha characters to be entered in a field, the field should be character type. If the fields are not the same data type, cast the querying field to match database field.
 
Back
Top