autofill a field depending on another field

bite_tony

Registered User.
Local time
Today, 15:53
Joined
May 15, 2012
Messages
23
I have a form in which there is a combo box which inserts customer addresses. So if i type in '8' it will list all client street addresses starting with eight and i can click the right one.
I have another field which i would like to autofill with the corresponding customer name but I just cant seem to get it right.

Any ideas?

Cheers..

(ha, i'm a poet and i don't know it:D...)
 
So long as the information you wish to display in the text box forms part of the Row Source for the combo, you can use the following in the Control Source of your text box;
Code:
=YourComboName.Column([B][COLOR="Red"]x[/COLOR][/B])
Where x is the number of the column in the combo that holds the data you wish to display. Remember that the columns in a Combo or List box for that matter are numbered from Zero on up.

The info you wish to display does not necessarily need to be visible in the combo it just needs to form part of the Row Source.
 
Try using a field called Customer ID in your Customer Addresses table which I hope you did. Now on the after update event of your Address Combo write the below code

"Select tblCustomers.FName from tblCustomers where Addresscombo.CustomerID=tblcustomers.CustomerID";

If you can upload your DB one amongst us can look into it...

Good Luck
 
i got it...
the form is 'service calls'
and im trying to populate 'customer name' after filling in 'customer address'
customer address currently autopopulates the customer ID field which is the FK from the customer details table...
 

Attachments

Do a compact and repair on your DB, then Zip it. When you make you next post use the Paper-clip button at the top of the posting window to upload your DB.

attachment.php
 

Attachments

  • Capture.JPG
    Capture.JPG
    22.3 KB · Views: 268
i didnt compact it, but its not huge...
Sorry, i knew it was the paperclip, i just couldnt find it...
I am having a very slow brain day...
 
THANKS!!!!!!
Although I'm not sure what you changed.
I had the same thing written in control source? (didn't i?)
can you tell me where i was going wrong?
 
i have compared them thoroughly, and i can't see what youve changed..i know you changed something because yours works and mine doesnt, haha
hmm...
 
Have a look at what I've done to the Row Source of your Combo, along with the column structure of your combo.

I did mention in Post #2 that the data you wish to display MUST form part of the Row Source of your combo
 

Users who are viewing this thread

Back
Top Bottom