A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo Box Lookup Value



 
 
Thread Tools Display Modes
  #1  
Old October 12th, 2009, 01:38 AM posted to microsoft.public.access.forms
ADonMS
external usenet poster
 
Posts: 19
Default Combo Box Lookup Value

I have created a form with combo boxes to lookup data from other tables. The
data updates to another table that I am trying to use in a query. When I run
the query, it returns the numerical value instead of the text value. The Row
Source on the combo box is a select query for the text value and when I use
the drop down on the form, it displays the text value. How can I change the
format in the query to show the text value?
  #2  
Old October 12th, 2009, 01:53 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Combo Box Lookup Value

On Sun, 11 Oct 2009 17:38:01 -0700, ADonMS
wrote:

I have created a form with combo boxes to lookup data from other tables. The
data updates to another table that I am trying to use in a query. When I run
the query, it returns the numerical value instead of the text value. The Row
Source on the combo box is a select query for the text value and when I use
the drop down on the form, it displays the text value. How can I change the
format in the query to show the text value?


It's showing a number because that's what is in the table. This is not a bug
or an error; it's perhaps a warning that you should not be using table or
query datasheets for viewing or editing data!

You can use a Query joining your current table to the combo box's row source
table (this would be typical if you're creating a Report, just include all the
needed lookup tables in the Report's recordsource query). To display the data
on a Form, use a query as with the report, or another combo box, or (rarely,
because of the performance penalty) a DLookUp function call.
--

John W. Vinson [MVP]
  #3  
Old October 12th, 2009, 03:06 AM posted to microsoft.public.access.forms
ADonMS
external usenet poster
 
Posts: 19
Default Combo Box Lookup Value

Oh. I see, now...I think. As long as I don't use the table with the combo
selections for my queries and reports its OK. What if my form was already
created with a combo box from a Lookup table, is this ok? Or would I need to
change my forms?

"John W. Vinson" wrote:

On Sun, 11 Oct 2009 17:38:01 -0700, ADonMS
wrote:

I have created a form with combo boxes to lookup data from other tables. The
data updates to another table that I am trying to use in a query. When I run
the query, it returns the numerical value instead of the text value. The Row
Source on the combo box is a select query for the text value and when I use
the drop down on the form, it displays the text value. How can I change the
format in the query to show the text value?


It's showing a number because that's what is in the table. This is not a bug
or an error; it's perhaps a warning that you should not be using table or
query datasheets for viewing or editing data!

You can use a Query joining your current table to the combo box's row source
table (this would be typical if you're creating a Report, just include all the
needed lookup tables in the Report's recordsource query). To display the data
on a Form, use a query as with the report, or another combo box, or (rarely,
because of the performance penalty) a DLookUp function call.
--

John W. Vinson [MVP]

  #4  
Old October 12th, 2009, 08:00 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Combo Box Lookup Value

On Sun, 11 Oct 2009 19:06:01 -0700, ADonMS
wrote:

Oh. I see, now...I think. As long as I don't use the table with the combo
selections for my queries and reports its OK. What if my form was already
created with a combo box from a Lookup table, is this ok? Or would I need to
change my forms?


It's perfectly appropriate, routine and ordinary to use Combo Boxes on a form,
to store a number value into a table, for display on a report using a query.

Don't confuse data STORAGE with data DISPLAY. They are different functions.
Your tables will very commonly contain several fields of numbers, where the
numbers are actually foreign keys to lookup tables elsewhere in the database.

Where Microsoft went wrong, in many of our eyes, was putting Lookup Fields in
Tables: see
http://www.mvps.org/access/lookupfields.htm
for a critique.
--

John W. Vinson [MVP]
  #5  
Old October 12th, 2009, 04:06 PM posted to microsoft.public.access.forms
ADonMS
external usenet poster
 
Posts: 19
Default Combo Box Lookup Value

Once again, you're awesome!! Thanks, much for the explanation and backup info.

"John W. Vinson" wrote:

On Sun, 11 Oct 2009 19:06:01 -0700, ADonMS
wrote:

Oh. I see, now...I think. As long as I don't use the table with the combo
selections for my queries and reports its OK. What if my form was already
created with a combo box from a Lookup table, is this ok? Or would I need to
change my forms?


It's perfectly appropriate, routine and ordinary to use Combo Boxes on a form,
to store a number value into a table, for display on a report using a query.

Don't confuse data STORAGE with data DISPLAY. They are different functions.
Your tables will very commonly contain several fields of numbers, where the
numbers are actually foreign keys to lookup tables elsewhere in the database.

Where Microsoft went wrong, in many of our eyes, was putting Lookup Fields in
Tables: see
http://www.mvps.org/access/lookupfields.htm
for a critique.
--

John W. Vinson [MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.