A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filtering a combo box on a subform using a value from the main for



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2008, 07:30 AM posted to microsoft.public.access.forms
Rayo K
external usenet poster
 
Posts: 28
Default Filtering a combo box on a subform using a value from the main for

I am trying to create a complex form. Let me first outline what I want to do
since you may know an easier way to do it.

I have a form called IssuesForm. This form has a combo box called department
with 9 departments (from a query on table issues). This is a subform of
IssuesMainForm. This form has a replica of the combo box based on the same
query. This main form will have the combo box invisible and locked and set to
a specific department. There will be a copy for each department. In addition
certain departments will have a check box checked on the main form that
prevents them from editing certain fields on the subform.

The subform will only display the records for the department selected on the
main form. on the subform is another combobox that allows the user to go to a
record based on the number (i.e. go to issue #234). The SQL for that combo is
he

SELECT [Open Issues Query].ID, [Open Issues Query].Department
FROM [Open Issues Query]
WHERE ((([Open Issues Query].Department)=[Department]))
ORDER BY [Open Issues Query].ID;

The problem is I want that combo to only show ID#s for the selected
department. Can you help me do this?
Am I going down a wrong path here?

Thanks!

  #2  
Old April 23rd, 2008, 02:35 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Filtering a combo box on a subform using a value from the main for

filter your query based on the value of the combo on the main form:
WHERE ((([Open Issues Query].Department)=[Forms]![IssueForm]![Department]))
--
Dave Hargis, Microsoft Access MVP


"Rayo K" wrote:

I am trying to create a complex form. Let me first outline what I want to do
since you may know an easier way to do it.

I have a form called IssuesForm. This form has a combo box called department
with 9 departments (from a query on table issues). This is a subform of
IssuesMainForm. This form has a replica of the combo box based on the same
query. This main form will have the combo box invisible and locked and set to
a specific department. There will be a copy for each department. In addition
certain departments will have a check box checked on the main form that
prevents them from editing certain fields on the subform.

The subform will only display the records for the department selected on the
main form. on the subform is another combobox that allows the user to go to a
record based on the number (i.e. go to issue #234). The SQL for that combo is
he

SELECT [Open Issues Query].ID, [Open Issues Query].Department
FROM [Open Issues Query]
WHERE ((([Open Issues Query].Department)=[Department]))
ORDER BY [Open Issues Query].ID;

The problem is I want that combo to only show ID#s for the selected
department. Can you help me do this?
Am I going down a wrong path here?

Thanks!

  #3  
Old April 27th, 2008, 08:51 AM posted to microsoft.public.access.forms
Rayo K
external usenet poster
 
Posts: 28
Default Filtering a combo box on a subform using a value from the main

Thanks that works. Is there a way to specify a generic master form. I.e. I am
tryong to use this subform on multiple forms, each time using the value for
department from the toplevel form.

e.g.
WHERE ((([Open Issues Query].Department)=[Me.ParentForm.[Department]))


Or can I pass an argument to the subform?


Thanks!

-Rayo


"Klatuu" wrote:

filter your query based on the value of the combo on the main form:
WHERE ((([Open Issues Query].Department)=[Forms]![IssueForm]![Department]))
--
Dave Hargis, Microsoft Access MVP


"Rayo K" wrote:

I am trying to create a complex form. Let me first outline what I want to do
since you may know an easier way to do it.

I have a form called IssuesForm. This form has a combo box called department
with 9 departments (from a query on table issues). This is a subform of
IssuesMainForm. This form has a replica of the combo box based on the same
query. This main form will have the combo box invisible and locked and set to
a specific department. There will be a copy for each department. In addition
certain departments will have a check box checked on the main form that
prevents them from editing certain fields on the subform.

The subform will only display the records for the department selected on the
main form. on the subform is another combobox that allows the user to go to a
record based on the number (i.e. go to issue #234). The SQL for that combo is
he

SELECT [Open Issues Query].ID, [Open Issues Query].Department
FROM [Open Issues Query]
WHERE ((([Open Issues Query].Department)=[Department]))
ORDER BY [Open Issues Query].ID;

The problem is I want that combo to only show ID#s for the selected
department. Can you help me do this?
Am I going down a wrong path here?

Thanks!

  #4  
Old April 27th, 2008, 12:20 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Filtering a combo box on a subform using a value from the main

No, queries don't know anything about Me.ParentForm.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Rayo K" wrote in message
...
Thanks that works. Is there a way to specify a generic master form. I.e. I
am
tryong to use this subform on multiple forms, each time using the value
for
department from the toplevel form.

e.g.
WHERE ((([Open Issues Query].Department)=[Me.ParentForm.[Department]))


Or can I pass an argument to the subform?


Thanks!

-Rayo


"Klatuu" wrote:

filter your query based on the value of the combo on the main form:
WHERE ((([Open Issues
Query].Department)=[Forms]![IssueForm]![Department]))
--
Dave Hargis, Microsoft Access MVP


"Rayo K" wrote:

I am trying to create a complex form. Let me first outline what I want
to do
since you may know an easier way to do it.

I have a form called IssuesForm. This form has a combo box called
department
with 9 departments (from a query on table issues). This is a subform of
IssuesMainForm. This form has a replica of the combo box based on the
same
query. This main form will have the combo box invisible and locked and
set to
a specific department. There will be a copy for each department. In
addition
certain departments will have a check box checked on the main form that
prevents them from editing certain fields on the subform.

The subform will only display the records for the department selected
on the
main form. on the subform is another combobox that allows the user to
go to a
record based on the number (i.e. go to issue #234). The SQL for that
combo is
he

SELECT [Open Issues Query].ID, [Open Issues Query].Department
FROM [Open Issues Query]
WHERE ((([Open Issues Query].Department)=[Department]))
ORDER BY [Open Issues Query].ID;

The problem is I want that combo to only show ID#s for the selected
department. Can you help me do this?
Am I going down a wrong path here?

Thanks!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.