Microsoft access dlookup function
For your example, you need to look up the Address, City, and State fields and ZIP code if you have it from your customer table where the CustomerID is the same as the CustomerID on your service form - or in this case, the value in your CustomerCombo box since you're picking from a list. The Domain is any table or query where your data resides. For example, if you want to get the last name of the customer whos ID is 5, then you'd say:. Since you're working with a service call form and the value of the CustomerID is in a combo box called CustomerCombo, you'd use the following line to get the selected customer's Address:.
When you put this in the AfterUpdate event for the CustomerCombo, the Address field can be automatically populated on your form. Here's a screen shot from one of my tutorials. The address fields are automatically populated when the customer is changed using the combo box. I teach the concepts in this free mini tutorial in my Access course. These are full courses - over 60 minutes in length each. I spend a lot more time going over how to do this, in addition to lots more tips and tricks.
I used. I keep getting an error message that it can't find the Code field. This seems like the simplist dlookup there could be but I can't get it to work. Was this reply helpful? Yes No. Sorry this didn't help. Thanks for your feedback.
Something like PropMarketCode would be better. I contains the name MarketCode. This thread is locked. You can follow the question or vote as helpful, but you cannot reply to this thread.
I have the same question 0. Report abuse. Details required :. Cancel Submit. Ken Sheridan. Any field that is included in Criteria must also be a field in Domain. Refresh If IsNull Me. How to Use DCount Function. How to Design and Create Database Table.
January 1, TGoldenEye. December 28, TGoldenEye.
0コメント