Neither dlookup or dcount worls in vba

dcavaiani

Registered User.
Local time
Today, 01:42
Joined
May 26, 2014
Messages
385
findcust = Mid(Me.Text0, InStrRev(Me.Text0, " ") + 1) & " " & Left(Me.Text0, InStr(Me.Text0, " ") - 1) ' If Nz(DLookup("[city]", "customers", "[customer]= '" & findcust & "'")) Then If DCount("[city]", "customers", "[customer]= '" & findcust & "'") > 0 Then

The findcust HAS the proper value in it and the customer field in the customers table has that same record (Primary Key), but the "THEN" code is not done ?
 
=DCount("*", "customers", "[customer]='" & findcust & "'")

=DLookup("[city]", "customers", "[customer]='" & findcust & "'") & ""

these work, I use them everyday.
if customer is a string.
 
=DCount("*", "customers", "[customer]='" & findcust & "'")

=DLookup("[city]", "customers", "[customer]='" & findcust & "'") & ""

these work, I use them everyday.
if customer is a string.
Yes, I find that works as well as long as it is the control source of a field on the Form
 
Yes, I find that works as well as long as it is the control source of a field on the Form
I'm sorry, I was looking at another line of code which was after the THEN - WHICH (the Then) WAS WORKING - DUH !
 

Users who are viewing this thread

Back
Top Bottom