parameters by combo boxes in a form

K

Kevin

I'm trying to create a dialog box that allows users to select 2 parameters
from combo boxes. The form is called 'frmEstimateSelector'.
It has 2 combo boxes:
'cboProjectName' (in which the Row Source is a table called 'Project')
'cboBidNumber' (in which the Row Source is a table called 'Bid').
The query I created is 'qryDialog' and in the criteria, the 2 parameters are
listed as:
[Forms]![frmEstimateSelector]![cboProjectName]
[Forms]![frmEstimateSelector]![cboBidNumber]

The first combo box works fine, but the second does not. Instead of
following the second criteria, it contains a repeat of the first combo box.
Any suggestions to resolve this? Any feedback is appreciated!
 
S

SteveS

Kevin said:
I'm trying to create a dialog box that allows users to select 2 parameters
from combo boxes. The form is called 'frmEstimateSelector'.
It has 2 combo boxes:
'cboProjectName' (in which the Row Source is a table called 'Project')
'cboBidNumber' (in which the Row Source is a table called 'Bid').
The query I created is 'qryDialog' and in the criteria, the 2 parameters are
listed as:
[Forms]![frmEstimateSelector]![cboProjectName]
[Forms]![frmEstimateSelector]![cboBidNumber]

The first combo box works fine, but the second does not. Instead of
following the second criteria, it contains a repeat of the first combo box.
Any suggestions to resolve this? Any feedback is appreciated!


You are missing a Where clause in the 2nd combo box and possibly a refresh
command.

Please post the row source for both combo boxes.
 
K

Kevin

Steve,
'cboProjectName' - Row Source is a table called 'Project'
'cboBidNumber' - Row Source is a table called 'Bid'

Please explain in more detail about the missing Where clause in the 2nd
combo box and where I might possibly need a refresh command.
Thanks again!
Kevin


SteveS said:
Kevin said:
I'm trying to create a dialog box that allows users to select 2 parameters
from combo boxes. The form is called 'frmEstimateSelector'.
It has 2 combo boxes:
'cboProjectName' (in which the Row Source is a table called 'Project')
'cboBidNumber' (in which the Row Source is a table called 'Bid').
The query I created is 'qryDialog' and in the criteria, the 2 parameters are
listed as:
[Forms]![frmEstimateSelector]![cboProjectName]
[Forms]![frmEstimateSelector]![cboBidNumber]

The first combo box works fine, but the second does not. Instead of
following the second criteria, it contains a repeat of the first combo box.
Any suggestions to resolve this? Any feedback is appreciated!


You are missing a Where clause in the 2nd combo box and possibly a refresh
command.

Please post the row source for both combo boxes.
 
S

SteveS

Kevin said:
Steve,
'cboProjectName' - Row Source is a table called 'Project'
'cboBidNumber' - Row Source is a table called 'Bid'

Please explain in more detail about the missing Where clause in the 2nd
combo box and where I might possibly need a refresh command.
Thanks again!
Kevin

Kevin,

Sorry... Apparently yesterday I had disengaged my brain when I read your
post. My comment about the missing 'Where' and the 'Requery' was about using
the first combo box to filter the second combo box (which you are not doing).

So I'll start over.

Normally when you use comb boxes as parameters for a query, the row source
is a query (SQL statement) with one or two fields: the primary key field and
the field of interest (like 'ProjectName') or just he field of interest
('ProjectName').

For 'cboProjectName', the row source might look like:

Select Distinct ProjectName From Project Order By ProjectName;

And for 'cboBidNumber':

Select Distinct BidNumber From Bid Order By BidNumber;


The advanatages of using the SQL statement are:
* it's faster - only one field (or two)
* can be sorted accenting or decending
* using 'Distinct' shows only one record, ie
TVA, not TVA
TVA
TVA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top