Solved

Combo box selection used in query criteria doesn't work

Posted on 2001-08-29
4
262 Views
Last Modified: 2006-11-17
I have it set up so that a value is selected in a combo box and that value is used in the criteria of a query.

When I select the value and click the button to run the query I get no results. If I use a text box to enter the value into and then run the query it works the way I want.

Any assistance?
0
Comment
Question by:awilson1199
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
dovholuk earned 100 total points
ID: 6436789
are you using a combo with multiple columns? if so, you need to specify the column you want to use as the criteria. for instance, if you had a combo with:

FirstName      LastName
jimmy             smits

on a form named form1 you would reference the "jimmy" column as:

forms!form1!combo1.column(0)
(zero based array for the columns as you can see above)

does this help? need more pointers?

dovholuk
0
 

Author Comment

by:awilson1199
ID: 6436881
It is a two column combo box but only the second column is visible and it is the value I need.

Here is the code in the criteria

[FORMS]![frmSoftware_on_Individual_Workstation]![cmboIndividualWorkstation.column(1)].

Using this code, modified as per your instructions, it is an improvement, it is at least asking for the value when I click to open the query. Before it would just run the query with no data returned.
0
 

Author Comment

by:awilson1199
ID: 6437033
Got me on the right path, and I solved it from there. I had two columns in the combo box but didn't really need the first column so I removed it and then used the suggestion and it solved the problem.

Thanks.
0
 
LVL 8

Expert Comment

by:dovholuk
ID: 6437039
right on. glad to have "pushed" you in the right direction.

dovholuk
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question