Combo box returns numeric values

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

Guest

I have a combo box that returns values back to my main table. However, the
way that I have the combo box setup, it returns the text values back as
numeric values because of the way they are sorted in the query that the combo
box values are collected from and because of the primary values the table has
autonumbered.

So now I want to run a query for the data that I've collected and I cannot
because when I set the criteria to a text value and try to retrieve those
values it shows nothing because all the data has been entered into the table
as numeric values. For example Wardrobe is seen as a 3. So I can search for
a 3 and get all the Wardrobe values, but if I put in Wardrobe it will show
nothing.

Please help.

Thanks,
Joe
 
Joe, check your bound column in the properties. It may set for the column
with the numeric value. Set the bound column to the text field that will
give you Wardrobe in the main table rather then 3.
***John
 
don't change baund column
just change (set) the first column lenght 0 (zero)
that you can see the value(i think text) which you want
and query from your baund column(number)
 
Joe

From your description, I'll hazard a guess that you are using a "lookup"
data type definition. One of the issues you can find many references to in
the "tablesdbdesign" newsgroup is how the "lookup" data field confuses folks
by storing one value, but displaying another. This shows up especially when
you get ready to query -- you "see" "wardrobe", so you search for it in your
query ... but the field holds a "3", so you never find it!

Is there a chance your underlying table is using a "lookup" data type?

If so, you'll either need to remember the above every time you query, or
you'll need to change the data type and do the "lookup" in forms, via combo
boxes, instead of directly in the table.
 
Actually I am not using the function - "dlookup". I am using the the Row
Source under the properties of the combo boxes. Basically I just used the
coding from this part of the support site -
http://support.microsoft.com/default.aspx?scid=kb;en-us;209576

After that I had everything working except the query to actually look up the
data. This is where I'm having the problem. As before it is returning
numeric values because that is the data type that the main table takes for
the "Dept" and "Location" fields. I am able to see what the numeric values
represent because of their primary keys in their own tables where each are
listed. When I go to search I can type the numeric value that represents the
Dept and it will show all the matches but in the Report I don't want it to
say the numeric value.

How do I make the report show the numeric values link to the text? In other
words, how do I get it to show Wardrobe instead of a 3, on the reports? It
doesn't matter to me what it shows in the actual main table as long as when
it is retrieved it writes something that is decipherable to someone else who
doesn't know what the number represents.

Thanks,
Joe
 
Joe

I wasn't referring to the dlookup function, but to field datatypes in table
definitions.

If you have a query that is returning the codes, but want to see the
"looked-up" values instead, open the query in design mode, add the "lookup"
table, and link on the lookup field. Select the value as a "field" in the
query. That's it -- you're done!
 
Back
Top