display textbox value help

  • Thread starter Thread starter crazy_beautiful_012
  • Start date Start date
C

crazy_beautiful_012

hi i have a problem. i have
COUNTRY table wit
countryid an
countryDescription fields

Now im trying to display the country id into a textbo
and the countryDescription to a combo box

what i want to happen is this
when i click on the name of the country on the combo bo
it should automatically display the countryid iof the chosen countr
name on the textbox

please help me with this. thanks
 
Hi crazy...,

have the combobox setup so that the id field is the first column and the
country name field is the second column. Ensure that the first column is the
bound column and is hidden (the wizard will guide you or use the field
properties dialog to check).

Next, on the field properties dialog for the combobox select from the list
of events, AfterUpdate. In the code editing window using the following as an
example of the code to type in this event:

private sub myCombobox_AfterUpdate()
txtNameOfTextboxForCountryID.value = myCombobox.value
end sub
 
crazy_beautiful_012 said:
hi i have a problem. i have a
COUNTRY table with
countryid and
countryDescription fields.

Now im trying to display the country id into a textbox
and the countryDescription to a combo box.

what i want to happen is this:
when i click on the name of the country on the combo box
it should automatically display the countryid iof the chosen country
name on the textbox.

please help me with this. thanks!

For BOTH the text box and the combo box, set the Control Source to
countryid.

For the combo box, set the properties as follows:

RowSource: SELECT countryid, countryDescription FROM COUNTRY
BoundColumn: 1
ColumnCount: 2
ColumnWidths: 0;

That should do the trick.
 
Back
Top