open report

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

kary via AccessMonster.com

Hi

Is it possible to make a label visible during the OpenReport command? I have
the following commands:

If option 1 is selected -->
DoCmd.OpenReport stDocName, acPreview, , "M1Ass1Comment='Fail M1Ass1'"
If option 2 is selected ->
DoCmd.OpenReport stDocName, acPreview, , "M1Ass2Comment='Fail M1Ass2'" ,
etc

However, I would like a different label on the report to be visible depending
on the selection. Is On Load the only way to achieve that?
Thank you
Kary
 
J

Jeff Boyce

Where are you (?proposing to be?) selecting this option?

If you use a form to "collect" your criteria, then open a report, the report
could "look" back at the form to set values.

You could even have a single label and change the "Caption" property's value
to whatever fit...

Good luck

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

kary via AccessMonster.com

1. I have a form with command buttons to select the item required eg Module
1, Module 2, etc.

2. My query calculates the Final mark for each Module of a course. In
addition it has a field for each Module with an IIF statement which marks the
students who fail by putting the text "Fail Modx". (Is there a better way to
do this as my sql command which shows in Sql View is long and cumbersome; I
know I don't really need to look at it but ..)

3. Then I need to print labels for all students who have failed. I would
like to have just 1 report printing these labels depending on which Module is
requested in step 1. The report prints fine with the OpenReport command
using a where condition. .
However, the Module they have failed may be in one of 6 fields of the query
so all 6 fields need to be added to the report which fills up the report
label and makes it messy.

SO, I'd like the control/field for "Fail Modx" to be invisible and then when
the selection is made in Step 1, for that modules control/field to become
visible.
Hope this makes sense!
Regards
Kary



Jeff said:
Where are you (?proposing to be?) selecting this option?

If you use a form to "collect" your criteria, then open a report, the report
could "look" back at the form to set values.

You could even have a single label and change the "Caption" property's value
to whatever fit...

Good luck
[quoted text clipped - 13 lines]
Thank you
Kary
 
K

kary via AccessMonster.com

Hi again
I have solved this problem! I declare a temporary variable (TempVars
("stLabel").Value = "M1A1 Fail") when selecting the Module in step 1 and then
use it as control source for a control on the label.
Many thanks for your help - your original comment about changing the
"captions value" made me start thinking!
Many thanks
Kary
1. I have a form with command buttons to select the item required eg Module
1, Module 2, etc.

2. My query calculates the Final mark for each Module of a course. In
addition it has a field for each Module with an IIF statement which marks the
students who fail by putting the text "Fail Modx". (Is there a better way to
do this as my sql command which shows in Sql View is long and cumbersome; I
know I don't really need to look at it but ..)

3. Then I need to print labels for all students who have failed. I would
like to have just 1 report printing these labels depending on which Module is
requested in step 1. The report prints fine with the OpenReport command
using a where condition. .
However, the Module they have failed may be in one of 6 fields of the query
so all 6 fields need to be added to the report which fills up the report
label and makes it messy.

SO, I'd like the control/field for "Fail Modx" to be invisible and then when
the selection is made in Step 1, for that modules control/field to become
visible.
Hope this makes sense!
Regards
Kary
Where are you (?proposing to be?) selecting this option?
[quoted text clipped - 11 lines]
 

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