Autopopulating field on form based on the value of another field on that form

charlie442

Registered User.
Local time
Today, 17:04
Joined
Jan 14, 2011
Messages
53
Hi

I have been playing around with dlookups over the weekend, but I am unable to figure this out. I have a form for entering new cases into my database (call it "Frm_New_Cases") whose control source is Tbl_Cases. One of the fields in this table is "Reference".

Now when I fill in the Reference field on Frm_New_Cases I would like the "Company" field to update automatically on the form based on a dlookup to static table called Tbl_Companies. Tbl_Companies has the fields "REF_NO", "COMPANY_NAME" etc. While the names of the fields are slightly different I should still be ble to use the Dlookup right?

Please could someone advice me how to do this. I'm guessing it's really simple but I m not the sharpest when it comes to VBA. However this will save my manager and I plenty of time when entering new cases. I will obviously roll this out to other fields but if I can get this one right I'll figure the rest out

Thanks
 
Look at "DemoReferenceA2002.mdb" (attachment, zip)
Yo don't need DLookup function. I made it via combo box, (f2RefNo).
Look at tables, form (VBA). Open form and see.
 

Attachments

Thanks

I have got to the bottom of this

Cheers
 
Thanks

I have got to the bottom of this

Cheers

Instead of deleting the thread, you should post what your solution was. Forums are not just for you. They are for many people searching for answers and if you are selfish and just delete your question after posting, nobody else gets the benefit of the solution.

So, please post your solution - this thread has been undeleted by me and is awaiting your response.


Bob Larson
Super Moderator
Access World Forums
 

Users who are viewing this thread

Back
Top Bottom