Query based on ComboBox selection

  • Thread starter khashid via AccessMonster.com
  • Start date
K

khashid via AccessMonster.com

I have a table "Master" with the following fields:

Master_No
Date
Name
Product
Agent

I want to have a form with combo boxes for the above fields and TextBox for
date, and a subform having Query or table type. I want user to be able to
filter the subform query based on the criterias chosen from the combobox and
date enterted in the textbox.

I believe I have managed to explain what I want. Anyhelp would be appreciated.
 
K

khashid via AccessMonster.com

I have just found out that I can use
=Forms!NameOfForm!NameOfBox

But that would not work for multiple boxes since user might only want to
choose one option
 
G

Guest

If the subform is based on a query in which the fields have filters set in
the criteria according to the selections in the combo boxes, then the subform
should restrict the records according to the selection.

You may need a record requery or refresh command in the after update event
of the last combo box.

--
http://www.patriotsquestion911.com
http://www.911truth.org
http://www.wtc7.net
http://www.st911.org
http://www.journalof911studies.com
http://www.pilotsfor911truth.org
http://ae911truth.org
 
K

khashid via AccessMonster.com

Is there anyother way, I have created a query based on Master. Can you guide
more
If the subform is based on a query in which the fields have filters set in
the criteria according to the selections in the combo boxes, then the subform
should restrict the records according to the selection.

You may need a record requery or refresh command in the after update event
of the last combo box.
I have a table "Master" with the following fields:
[quoted text clipped - 10 lines]
I believe I have managed to explain what I want. Anyhelp would be appreciated.
 
G

Guest

Have you inserted all your filters in the query or SQL? If so, have you put
them all on the same line?

Try putting them on separate lines then that will make it "OR" instead of
"AND". I think that may work. Other than that, I wouldn't know.


khashid via AccessMonster.com said:
Is there anyother way, I have created a query based on Master. Can you guide
more
If the subform is based on a query in which the fields have filters set in
the criteria according to the selections in the combo boxes, then the subform
should restrict the records according to the selection.

You may need a record requery or refresh command in the after update event
of the last combo box.
I have a table "Master" with the following fields:
[quoted text clipped - 10 lines]
I believe I have managed to explain what I want. Anyhelp would be appreciated.
 
K

khashid via AccessMonster.com

Thanks its working now but what should I do to clear any combo box so i can
get nonfiltered data in the query, and also it does not show any result
unless I choose all combo boxes
Have you inserted all your filters in the query or SQL? If so, have you put
them all on the same line?

Try putting them on separate lines then that will make it "OR" instead of
"AND". I think that may work. Other than that, I wouldn't know.
Is there anyother way, I have created a query based on Master. Can you guide
more
[quoted text clipped - 11 lines]
 
K

khashid via AccessMonster.com

This is what I got

SELECT Outbound.[Call No], Outbound.Date, Outbound.Campaign, Outbound.CSR,
Outbound.[Call Type], Outbound.[Card Type], Outbound.[Card No], Outbound.
[Customer Name], Outbound.[Customer Address], Outbound.City, Outbound.
[Customer Ph], Outbound.[Customer Cell], Outbound.Response, Outbound.[Sub
FollowUp], Outbound.[Sub NotInterested], Outbound.AppointmentDate, Outbound.
[Diverted to], Outbound.[Call Back], Outbound.Comments, Outbound.[Other
Comments]
FROM Outbound
GROUP BY Outbound.[Call No], Outbound.Date, Outbound.Campaign, Outbound.CSR,
Outbound.[Call Type], Outbound.[Card Type], Outbound.[Card No], Outbound.
[Customer Name], Outbound.[Customer Address], Outbound.City, Outbound.
[Customer Ph], Outbound.[Customer Cell], Outbound.Response, Outbound.[Sub
FollowUp], Outbound.[Sub NotInterested], Outbound.AppointmentDate, Outbound.
[Diverted to], Outbound.[Call Back], Outbound.Comments, Outbound.[Other
Comments]
HAVING (((Outbound.CSR)=[Forms]![Outbound Test]![F_CSR]) AND ((Outbound.[Call
Type])=[Forms]![Outbound Test]![F_CallType]));
Thanks its working now but what should I do to clear any combo box so i can
get nonfiltered data in the query, and also it does not show any result
unless I choose all combo boxes
Have you inserted all your filters in the query or SQL? If so, have you put
them all on the same line?
[quoted text clipped - 7 lines]
 
G

Guest

Search around for threads. I have seen messages before that answers this but
I can't remember what it is.

It might be better to start a new thread if you can't find the answer.



khashid via AccessMonster.com said:
Thanks its working now but what should I do to clear any combo box so i can
get nonfiltered data in the query, and also it does not show any result
unless I choose all combo boxes
Have you inserted all your filters in the query or SQL? If so, have you put
them all on the same line?

Try putting them on separate lines then that will make it "OR" instead of
"AND". I think that may work. Other than that, I wouldn't know.
Is there anyother way, I have created a query based on Master. Can you guide
more
[quoted text clipped - 11 lines]
I believe I have managed to explain what I want. Anyhelp would be appreciated.
 

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