Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    300

    Question Unanswered: Choosing correct report to print for user

    I hope that this is easily done.

    How can I set up a macro to print REPORT A if a check box in a TABLE is set to YES and REPORT B if there is NO check in the check box???

    THKS IN ADVANCE

  2. #2
    Join Date
    Sep 2003
    Posts
    228
    do you know how to code VB? The task would be much easier....

  3. #3
    Join Date
    Sep 2003
    Posts
    228
    When in macro design view...
    Click View->Conditions
    Now you can put your condition in the 'Condition' Column.

    if your checkboxes are also on the form from where the macro is run you can put in, [ReportA] = Yes, etc...

    Or you can put it in the form of a DLookup, Dlookup("[ReportA]", "[Table Name]","[Some Field] = Some Value") = Yes

  4. #4
    Join Date
    Nov 2003
    Posts
    300
    Thanks Ottomatic, that gives me some of what I want but not all.

    I think that a VB solution would be the best, if you or someone could let me know what I can do in VB that would be great!

    For it to work in the macro, I would need to use some sort of an IF ELSE statement but I have not figured it out..

    Again, a user hits a print button, if the value [checkbox] is YES, it prints REPRT A, if NO, it prints REPRT B.

  5. #5
    Join Date
    Sep 2003
    Posts
    228
    I think the macro condition would work for you. Just enter two conditions:
    chkbox.value = 1
    chkbox.value = 0

    in the action column open the appropriate report.

    Otherwise, go to the properties of the command button and build an onClick event. There you would put an if ... else structure based on the checkbox's value. You would open one report under the if and the other under the else.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •