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
Solved

Combo box selection used in query criteria doesn't work

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

840 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