Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup not working Error cancelled operation 1

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
0
0
US
I am trying to set up a form to enter a name into a textbox and have an ID number populate another textbox. I am not getting an error but the destination textbox is not populating.
Here is the details
Table: dbo_dic_Client
Name of the form: frmMain
Form Data Entry text box: txtClient
Form Destination textbox: txtClientNum
ID Field from table clid
info from table: uci

Code:
Private Sub txtClient_Exit(Cancel As Integer)
Dim intClient As Integer

intClient = DLookup("clid", "dbo_dic_Client", "uci = " & Forms![frmMain]!txtClient)
Debug.Print intClient
frmMain!txtClientNum = intClient

End Sub
 
What about this ?
Code:
Dim intClient As Vatiant
intClient = DLookup("clid", "dbo_dic_Client", "uci = '" & Me!txtClient & "'")
Debug.Print intClient
Me!txtClientNum = intClient

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top