Open Form / Where Condition

  • Thread starter Thread starter Harvard
  • Start date Start date
H

Harvard

I have a report (rptStrategicPlan) that has 2 subheadings: 1) goals 2)
objectives. I'm trying to make this report open up a form (either goal or
objectives) when that subheading is clicked. For instance, if you were to
click on objective 1.2, I would want the frmObjective to open and list all
corresponding details under objective 1.2.

To accomplish this, I used an 'OpenForm' macro with this 'where condition':
Reports![rptStrategicPlan]![SubObjectiveID] = Forms![tblAnnualPlan
Subform]![SubObjectiveID]

When I run this macro, the form will open, but no records appear. Any
assistance would be much appreciated!
 
If you want the form to find the value from the report, why are you putting
the report's value first?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks Jeff,

That helped a lot. Now I've got one more question for you...When I double
click this macro in the report it brings up an "Enter Parameter Value"
window, and then I have to manually type in the subobjectiveID that i want.
is there a way to automatically get the value to popup so that it opens the
form on the correct id?

Jeff Boyce said:
If you want the form to find the value from the report, why are you putting
the report's value first?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Harvard said:
I have a report (rptStrategicPlan) that has 2 subheadings: 1) goals 2)
objectives. I'm trying to make this report open up a form (either goal or
objectives) when that subheading is clicked. For instance, if you were to
click on objective 1.2, I would want the frmObjective to open and list all
corresponding details under objective 1.2.

To accomplish this, I used an 'OpenForm' macro with this 'where
condition':
Reports![rptStrategicPlan]![SubObjectiveID] = Forms![tblAnnualPlan
Subform]![SubObjectiveID]

When I run this macro, the form will open, but no records appear. Any
assistance would be much appreciated!
 
If you base your form on a query that looks to the same source that you're
using for selecting your report (i.e., the other form), then when that form
opens it would use a query that uses the first form's value (you'll have to
tell Access where to look, but this is the generic idea.)


In the future, you'll find you get a lot more folks looking at your question
if you post a new thread, rather than continue one you've started in a new
direction...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Harvard said:
Thanks Jeff,

That helped a lot. Now I've got one more question for you...When I double
click this macro in the report it brings up an "Enter Parameter Value"
window, and then I have to manually type in the subobjectiveID that i
want.
is there a way to automatically get the value to popup so that it opens
the
form on the correct id?

Jeff Boyce said:
If you want the form to find the value from the report, why are you
putting
the report's value first?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Harvard said:
I have a report (rptStrategicPlan) that has 2 subheadings: 1) goals 2)
objectives. I'm trying to make this report open up a form (either goal
or
objectives) when that subheading is clicked. For instance, if you were
to
click on objective 1.2, I would want the frmObjective to open and list
all
corresponding details under objective 1.2.

To accomplish this, I used an 'OpenForm' macro with this 'where
condition':
Reports![rptStrategicPlan]![SubObjectiveID] = Forms![tblAnnualPlan
Subform]![SubObjectiveID]

When I run this macro, the form will open, but no records appear. Any
assistance would be much appreciated!
 
Back
Top