want text not number

  • Thread starter Thread starter Chrissy
  • Start date Start date
C

Chrissy

I have a field on a form that retrieves data that had
been entered into the table via combo box on another
form, another time, with an autonumber assigned.

The field shows the number not the text. How do I get
this form to show the text from that table, not the
autonumber?

C
 
Chrissy said:
Thanks Rick.

I get #name. Is that because the form with the combo is
not open? It won't be. The combo is not on this form.
The control is just a text box set to the field in the
table. How would I get column(1) out of the table? Column
(0) being the autonumber that now returns and column(1)
being desired text to show.

Ok, my bad. I was interpreting the original post to mean that you were referencing
the other form while it was open to grab the value from the Combo. What you need is
to display a lookup value. This is a common situation where for example, a
CustomerID number is stored in an Orders table and you want to display the
CustomerName instead.

You have a few options here. You can replace the TextBox with a ComboBox that is set
up the same as the one used to enter the data. That is; it displays one thing but
stores another. If you copy that Combo from the other form onto this one it might
just work as desired with no modification.

You can also modify the RecordSource of your form by adding in the table that stores
the lookup text. Then include and use the text lookup field for your TextBox instead
of the number field. This solution would not be editable.

You can also just use a TextBox with a DLookup() function as the ControlSource to
retrieve the text value from the Lookup table using the number value as the criteria.
 
Thanks, Rick. DLookup did the job!


-----Original Message-----


Ok, my bad. I was interpreting the original post to mean that you were referencing
the other form while it was open to grab the value from the Combo. What you need is
to display a lookup value. This is a common situation where for example, a
CustomerID number is stored in an Orders table and you want to display the
CustomerName instead.

You have a few options here. You can replace the
TextBox with a ComboBox that is set
up the same as the one used to enter the data. That is; it displays one thing but
stores another. If you copy that Combo from the other form onto this one it might
just work as desired with no modification.

You can also modify the RecordSource of your form by
adding in the table that stores
the lookup text. Then include and use the text lookup field for your TextBox instead
of the number field. This solution would not be editable.

You can also just use a TextBox with a DLookup()
function as the ControlSource to
 
Back
Top