Textbox and COmbobox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all...
I have a form based in a "tableid" with "id","name","adrees","idclub"
this "idclub" is a combobox based on "tableclub" which have
"idclub","name","stadium".... and appears the name of teh club...

what i want is a textbox in my form that show the stadium from tableclub but
based on the choise on club of ther person"comboboxidclub".

anyone help me?
thanks in advance
 
I suspect that the combobox currently has two columns, idclub and name. Add
the stadium field to the query in the combo box's Row Source and set the
combo box to 3 columns. Set the width of the 3rd column as desired. In the
textbox, set its Control Source to
=comboboxidclub.Column(2)

The Column index is zero based, so 0 is the first column, 1 is the second,
etc.

Also, Name isn't a good name for a field. Name is a reserved word and has
the potential to cause you problems.
 
The combo returns 3 fields, so on an unbound text box you can set the
control source to be

=MyComboBox.Column(3)
 
Thanks Wayne and John..

But one mor question... imagine that in club table i have the adress of the
club, which is Memo type.. how could i do that (place the adress of the club
in a textbox) if memo can't be on a combo box?

regards,
 
First, why is the address Memo type instead of separate fields for Street
Address, City, State, etc? You can concatenate them together later if you
want them displayed as if they were one field. Memo fields, while useful,
ought to be a "last resort" option.

Next, you could try DLookup. I tried it just to make sure that it would
return more than 255 characters. I got it up to 380 and quit testing.

Textbox Control Source:
=DLookup("[MemoFieldName]", "[tableclub]", "[idclub]=" & coboboxidclub)

This assumes that idclub is the Bound Column of the combo box, if not,
you'll have to specify the column as in the previous example. It also
assumes that idclub is a number field. If it is a text field, you'll have to
concatenate quotes in around the value.

=DLookup("[MemoFieldName]", "[tableclub]", "[idclub]='" & coboboxidclub &
"'")
 
Back
Top