If DLookup IsNull - Help Needed

cinders

Registered User.
Local time
Today, 11:18
Joined
Aug 28, 2001
Messages
48
I have an Unbound Form that has two text boxes, One called Appointment ID, the other Transaction Type.

When the user Enters an Appointment ID, the Transaction Type automatically populates by way of the DLookup function.

In some cases an appointment ID does not exist, thus no corresponding Transaction Type. This is normal. I need the user to be able to input the transaction type manually when there is no Appointment ID.

So when there isn't an appointment ID with a corresponding transaction type in the underlying table that the DLookup uses, the appointment ID is left blank and I need the user to be able to manually input the transaction type.

Any thoughts?

Thanks

Cindy
 
you can use the NZ function to trap for Dlookup returning null
Code:
string = Nz(dlookup(),"")
then check to see if the returned value is "" and use an inputbox to have the user enter the neccessary value.
 
Why do you use DLookUp, why not a Combo Box? :confused:
 
Rich said:
Why do you use DLookUp, why not a Combo Box? :confused:

I am simulating an application for training purposes and it is the way the original application was developed. Plus the Combo box would be far too large due to the number of entries in the table.
 
Hello Everyone,

I am still having trouble with this....

I am duplicating a production database for training so I need to mirror the original database (have no idea what the original was developed in) Anyway this is just a mock up for training purposes.

The user enters an Appointment Number (this is predetermined and lives in a table) The next field TransactionType auto populates with the transaction number based on the appointment ID that was entered. There are situations where someone will show up without an appointment ID OR they are late for their appointment.

In this scenario the user either backspaces over the appointment number (when the appointment is late) or leave the appointment number blank when there is no scheduled appointment and tabs to the transaction number. They should be able to enter the transaction number for a "non/late appointment"

This field will not allow me to enter anything because it is based on a DLookup.

Anyone have any suggestions on how to handle this without having an additional field pop up to enter the transaction type. I need to be able to somehow overwrite the Dlookup, but still have the lookup function.

Thoughts???

Thanks

Cindy :(
 
It sounds like you have dual criteria for executing what you want to do without an example of your code it's hard to offer advice.
What trigger method are you using for executing the function.
Can you upload a copy of the form/code and related tables that your working with?
 
Because my 'little application' is so convoluted I am concerned that making it available may make things more confusing. I had a thought to run by everyone.

Would using a variable that is based on another hidden DLookup field, as the source of the display field work? Would I be able to overwrite the value of the variable in that field? Any thoughts??

.....Cindy aka stumped :confused:
 
If you think it may solve your problem then go ahead and try, don't let us stop you.
 

Users who are viewing this thread

Back
Top Bottom