You've stumbled upon one of my pet peeves by building the criteria string within the command - and it's not your fault because that's how a majority of examples show how to use the command.
Instead I suggest that you build the string first and then use the string in the command.
Why you might ask, because you can then check how the string is actually resolving; thus, making troubleshooting the code so much easier as
most of the time the issue is with something missing or not resolving properly/as expected within your string.
So to use your code:
- Private Sub Item___AfterUpdate()
-
-
DIM strSQL as string
-
strSQL = "[Supplier_ID]='" & Me.Supplier_Id & "'"
-
'
-
'now you can insert a debug print here for troubleshooting
-
' - press <ctrl><g> to open the immediate window
-
' - you can now cut and paste this information for review!
-
'
-
debug.print "Your criteria = " & strSQL
-
'
-
'now use the string in your code:
-
Me.Supplier = DLookup("Supplier", "Supplier List", strSQL)
If you will make these little changes and post back the resolved string we can help you tweak the code.
The second thing to look at...
Me.Supplier_Id
- are you sure that this is a text field?