Dlookup (1 Viewer)

Inusah

New member
Local time
Today, 20:42
Joined
Jul 19, 2022
Messages
2
I have a table named frmNew with 3 fields; CustomerNo, Except and Status.
The status can either be open or closed.

I have a form named, frmNew with 3 text boxes of txtCusNo, Except.

I want a vba code (preferrably, with Dlookup) that will look up the CustomerNo on the table anytime a customer number is specified in the txtCusNo and if the status is open, it should show a messagebox of "I like this".
 

Minty

AWF VIP
Local time
Today, 21:42
Joined
Jul 26, 2013
Messages
10,371
Why not have a combo box with all three fields as columns and simply use that to select your customer number and display the status at the same time.

It also prevents typing in a non-existent customer number.
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:42
Joined
Sep 21, 2011
Messages
14,275
I have a table named frmNew with 3 fields; CustomerNo, Except and Status.
The status can either be open or closed.

I have a form named, frmNew with 3 text boxes of txtCusNo, Except.

I want a vba code (preferrably, with Dlookup) that will look up the CustomerNo on the table anytime a customer number is specified in the txtCusNo and if the status is open, it should show a messagebox of "I like this".
Here you go.

 

Users who are viewing this thread

Top Bottom