Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup and Display2 1

Status
Not open for further replies.

storyboy

Programmer
Sep 16, 2004
25
US
I didn't make myself very clear before, sorry. I am creating an invoice system. My invoices involve two files, one for the header info and the second for the products ordered. In the header I have the entery person enter the customer code, then I want the customer name, address etc. to be displayed based on customer code. The customer info is located in the customer file, that is a third file used only for look up of that information. If I use dlookup it displays the infor later, after the fact. I would like that customer info to show up right away. Is it possible that something could be put in the customer code control, lost focus property that would then go out and look that info up and display it. I'm not sure how best to do this. Please help me with this. Thank you very much.
 
If the DLookUp is used in the ControlSource property of a TextBox you may call the Requery method of this TextBox in the AfterUpdate event procedure of the ComboBox.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you for your reply. I have the dlookup in the controlsource property of the textboxs but I don't know how to requery in the afterupdate event procedure of the combo box.

the customer file is FILCUSTOMER
Fields fldcco (customer code)
fldna (name )
fldstr (street)
fldcty (city state and zip)
I did set up a combo box for the fldcco (customer code)

My intent is to have the form take in the customer code, then display the name, street, and city stuff for varification to the user. The customer table that this needs to be retrieved from is part of the database but not part of the invoice information accept the customer code. I want to go get the information and show it, and that's really all I want to do with it at this point.
 
I don't know how to requery
[textbox name].Requery

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
When I put the [textbox name].requery in the AfterUpdate Event rocedure of the combo box, it tells me can't find macro of that name.

Is there another way to get data from another file to display on a form that would be easier. Perhaps I am going about this all the wrong way. Please advise. Greatly appreciated.
 
Check that the OnAfterUpdate property is set to [event procedure] and then click the ellipsis (...) to go in VBA code.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, yes, and yes. It worked, and I thank you so very much. Works beautiful and is just what I wanted, and they need. Should name my first born after you, just don't know how the family would pronounce PHV. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top