Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Row Source / Mask

Status
Not open for further replies.

markronz

IS-IT--Management
Mar 20, 2007
93
US
Hello everyone, first I have a Combo box that has a control source value for the data in my database. Then I have the Row Source filled in for the combo box so that it displays what I want in place of the real value.

The Control Source is set to the "Type" value in my database. The Row Source says: "A;Type 1;B;Type 2;C;Type 3"

So for example, if my current item has a "Type" of a "A" then what actually displays in the combo box is "Type 1"

Now, what I want to do is the exact same thing, but with a TEXTBOX. I now have a different textbox that is also binded with the "Type" value in my database. I want the textbox to do this same substitution and show "Type 1" instead of "A"

Does anyone know how to do that? Or do I just have to change the textbox to a combo box? I would rather leave it as a textbox, that's why I asked.

Thanks everyone!

 
Not sure I understand what exactly you are doing here, but I would advise against using "Type" as a field name, as I believe it is a reserved word in VBA.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Thanks genomon, but that was just an example, in my real database, its an entirely different name and value list. Ignore the fact that I used the word.

Basically what I'm doing is that I have a textbox that is bound to a field in my database. If the field in the database is a 1, I want the textbox to say something else, not 1.

Please let me know if anyone needs any more clarification on this.

Thanks!
 
Try setting its control source =Replace([yourfield],"1","yourstring")

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
What can be done is create a table with 2 fields

letter,typename
a , type1
b, type2
c, , type3


and join it to your recordsource

 
or

set the control source of the text box

"type " & Asc(ucase("type"))-64
 
Is the COmbo Box and the text box duisplaying records from the same table or query ?

If so, just reference the combo box.

In the combos after_update event:

me.mytextbox = me.mycombo.column(x)

(Where X is the column number that has the data)

You can have as many columns as you want in the combo. Just set their width to 0 in the properites page if you don't want to see them.

Tyrone Lumley
SoCalAccessPro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top