Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Query based on ComboBox selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
khashid - 16 May 2007 10:45 GMT
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.
khashid - 16 May 2007 10:52 GMT
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

>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.
scubadiver - 16 May 2007 11:34 GMT
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.

Signature

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

> 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.
khashid - 16 May 2007 11:41 GMT
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
[quoted text clipped - 8 lines]
>>
>> I believe I have managed to explain what I want. Anyhelp would be appreciated.
scubadiver - 16 May 2007 13:46 GMT
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.
khashid - 16 May 2007 17:32 GMT
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]
>> >>
>> >> I believe I have managed to explain what I want. Anyhelp would be appreciated.
khashid - 16 May 2007 17:57 GMT
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
[quoted text clipped - 5 lines]
>>> >>
>>> >> I believe I have managed to explain what I want. Anyhelp would be appreciated.
scubadiver - 17 May 2007 07:36 GMT
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.

> 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
[quoted text clipped - 11 lines]
> >> >>
> >> >> I believe I have managed to explain what I want. Anyhelp would be appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.