Solved

Combo box selection used in query criteria doesn't work

Posted on 2001-08-29
4
230 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now