Automatically populate a text field on a form

S

Shelley

I have a form which has a combo box and text box on it.
When I select an item from the combo box(Style Name) I
would like the text box to populate with the Style Code. I
have a table with 2 fields that stores the Name and Code
but I am having difficulty getting the the textbox to fill
automatically.

Can someone please advise?

Thanks
 
K

Kelvin Lu

If you do not need to edit the textbox containing the Style Code there is an
easy method. Set the query for the drop down box to contain both the
StyleNme and StyleCode fields. Then for the source of the text box set it
to "= cmbStyleName.Column(1)". If you want to be able to change the
contents of the text box then use the AfterUpdate event of the drop-down box
to set the value of the text box "txtStyleCode = cmbStyleName.Column(1)".

Kelvin
 
S

Shelley

Thanks Kelvin, that worked a treat! I can't believe it
was that simple!

Thanks again.
Shelley
 
K

Kelvin Lu

Isn't it amazing how simple things after you find out. Thats the way life
goes. Glad I could be of help.

Kelvin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top