Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combo box selection used in query criteria doesn't work

Posted on 2001-08-29
4
Medium Priority
?
272 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

722 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