DLookup Problems

smjohns

Registered User.
Local time
Today, 21:59
Joined
Mar 15, 2004
Messages
20
Hi,

I am fairly new to Access development so please excuse the newbie question.

I am creating a form which has a drop down list field with various values. Depending on what I select, to view only protected fields are populated using a dlookup statement such as the following:

=DLookUp("[Travel_Date]","Reservations","[Reserve_ID] = " & Forms!Transport_Company_Payment_Record_Add!Reserve_ID & "")

When I view the completed form, these fields are defaulted with "#error" but on selecting a value in the reserve_id field, these fields become correctly filled.

Is there a way of defaulting these view only fields as blank if the drop down list field is blank? so I do not get the #error? I know this is possible as I have another screen using the same technique but this works. I have done comparisons but have no idea why it works on one screen but not another.

Any help will be much appreciated.

Regards

Si
 
Oh I forgot to mention that the above dlookup statement is placed in the Control Source option for the output field.
 

Users who are viewing this thread

Back
Top Bottom