Solved

Combo box selection used in query criteria doesn't work

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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.

759 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

19 Experts available now in Live!

Get 1:1 Help Now