Automatically populate a text field on a form

  • Thread starter Thread starter Shelley
  • Start date Start date
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
 
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
 
Thanks Kelvin, that worked a treat! I can't believe it
was that simple!

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

Kelvin
 
Back
Top