Dlookup Problem 2 time

liza_adam

New member
Local time
Today, 08:57
Joined
Dec 9, 2002
Messages
6
I have many fields in my table main and it’s:
AWB number
Cust_name text
Mobile text
Cite text
------------------------------------------
Cust_address text
Status text

So what I want is when I enter an AWB number and press enter all the matching data in the field must appear. And for the first three fields users can see the data and can’t change it (read only). And for the cust_address, Status they can change it.
I used for that Dlookup function but what happens is when I enter the AWB number for the second time all the data in the table will be deleted for cust_address and status fields.

My code is in the attachment file.

Thank you very much.
 

Attachments

  • code.jpg
    code.jpg
    79.7 KB · Views: 155
Instead of using DLOOKUP you should include the source table in the forms datasource forming a join between the AWB field and its corresponding entry in the data entry table.

If you do not always want these details to be presented then the easiest way is to have all fields on the form but hidden, then you can pick and choose which you want to force upon the user or which you want to suggest as default values.

This is much more efficient than using numerous DLOOKUP functions.
 

Users who are viewing this thread

Back
Top Bottom