J
JessiRight77
I have a form with several tab controls. I also have a subform on the
main form.
I have placed a command button on the main form that calls a macro that
displays a report for the individual record that is currently active.
This works fine, EXCEPT I cannot figure out how to make the macro also
refresh the form before it displays the report for a new/revised
record. (My report is based on a query that includes the primary key
of the underlying table).
Various things I have tried:
1. inserting a "Requery" command (with no argument) before the
"OpenReport" command... but this displays the report for the FIRST
record, not the current record.
2. adding the name of the tab control to the argument section of the
Requery command... but this doesn't work either.
3. making the macro close and open the form *before* printing the
report... but when the form re-opens, it then displays the report for
the FIRST record.
With regard to attempt #3, I also thought about making the macro assign
the primary key of the current record to a variable before it closes,
so it can go back to that record when it re-opens... but I don't see a
command for that.
Does anyone have thoughts or suggestions on how I can do this?
Thanks,
Jessi
main form.
I have placed a command button on the main form that calls a macro that
displays a report for the individual record that is currently active.
This works fine, EXCEPT I cannot figure out how to make the macro also
refresh the form before it displays the report for a new/revised
record. (My report is based on a query that includes the primary key
of the underlying table).
Various things I have tried:
1. inserting a "Requery" command (with no argument) before the
"OpenReport" command... but this displays the report for the FIRST
record, not the current record.
2. adding the name of the tab control to the argument section of the
Requery command... but this doesn't work either.
3. making the macro close and open the form *before* printing the
report... but when the form re-opens, it then displays the report for
the FIRST record.
With regard to attempt #3, I also thought about making the macro assign
the primary key of the current record to a variable before it closes,
so it can go back to that record when it re-opens... but I don't see a
command for that.
Does anyone have thoughts or suggestions on how I can do this?
Thanks,
Jessi