Reputation: 237
Basically it says I am missing operators?
Dim descpc As String
despc = DLookup("[Description]", "[products/stock]", "[Product Code] = " & Me.cmbSource.Value)
Me.Text47.Value = despc
Can anyone spot anything? I'm not 100% with Dlookup so any help would be brilliant!
Thanks, Bob P
Upvotes: 0
Views: 167
Reputation: 499
You're dim-ing cmbSource as a string, so you'll need to enclose the value in sigle quotes to handle the string. Also, if Product Code is a number, you might get an error if you're then trying to compare a string to an integer. Try this:
despc = DLookup("[Description]", "[products/stock]", "[Product Code] = '" & Me.cmbSource & "'")
Upvotes: 1