Access 2010 Run-time error '3464' PLEASE HELP FAST

Joined
Aug 26, 2012
Messages
2
Reaction score
0
Ok my problem is that this one form is resisting. The dlookup code im using is being a dick and not allowing me to continue. This code is pretty basic:
Code:
 Private Sub Itemid_AfterUpdate()
    Itemid = DLookup("Itemid", "Merchandise", "Itemid=" & Itemid)
    Itemname = DLookup("Itemname", "Merchandise", "Itemid=" & Itemid)
    Itemdescription = DLookup("Itemdescription", "Merchandise", "Itemid=" & Itemid)
    Itemtype = DLookup("Itemtype", "Merchandise", "Itemid=" & Itemid)
    Itemsell = DLookup("Itemsellprice", "Merchandise", "Itemid=" & Itemid)
    Stock = DLookup("Stock", "Merchandise", "Itemid=" & Itemid)
End Sub
The table, is called merchandise and it is fully populated, and all spelling is correct. The form is the same. HOWEVER, I continue to recieve the error.
I've used this same code structure in another form:
Code:
Private Sub Clientid_AfterUpdate()
    
    Clientname = DLookup("Clientname", "Client Data", "Clientid=" & Clientid)
    Clientuser = DLookup("Username", "Client Data", "Clientid=" & Clientid)
    Clientpass = DLookup("Userpassword", "Client Data", "Clientid=" & Clientid)
    Clientemail = DLookup("Email", "Client Data", "Clientid=" & Clientid)
End Sub
This however works???
If you can tell me where I went wrong please do soon!
PLEASE HELP ME!
 
Ok, ive tried searching google, and have come out empty handed. The search results have nothing to do with the dlookup.
I dont know if there is a problem with my code or what...
 
Is the ItemID field in the table that it pulls from a text field? Even if it only contains numeric values, if it is a text field, you'll need to use something like the following for the last part of the DLOOKUP:

"Itemid = '" & Itemid & "'"

Short of that, I probably can't help you. Good luck!
 
Back
Top