Macro to update report

grenee

Registered User.
Local time
Today, 05:59
Joined
Mar 5, 2012
Messages
212
Good Day all.

I would like to know how to have a report updated automatically if a recorded is changed in on a form while the report is opened.

My approach was to place a requery Macro on the form to be activated by a click on the form but that is not working either.
 
create a macro that closes first the report (CloseWindow->ObjectType:Report, Object Name: yourReportName, Save: No) followed by opening the report (OpenReport->Report Name: yourReportName, View: Print Preview, Window Mode: Normal, )
 
Thanks for the suggestion
 
here's a step to accomplished it without getting errors:

1. Create a macro.

OnError
Go to: Macro Name
Macro Name: SUB2


CloseWindow
Object Type: Report
Object Name: yourReportName
save: No


RunMacro
Macro Name:
Repeat Count:
Repeat Expression:


2. Right click on the "OnError" macro and select "Make Submacro block" on the pop-up menu.
Name your Submacro SUB1

3. Save your macro.

4. Go to the last line of your Submacro and select "Add New Action".
If there are two "Add New Action" textbox, just select the last one.


OpenReport
Report Name: yourReportName
View: Print Preview
Filter Name:
Where Condition:
Window Mode: Normal


5. Right click on the above macro (OpenReport) and select "Make Submacro block" on the pop-up menu.
Name your Submacro SUB2.

6. Now go back to Submacro SUB1 and edit the macro RunMacro


RunMacro
Macro Name: yourMacroName.SUB2
Repeat Count:
Repeat Expression:



7. Save your macro.

8. On your forms command button, set the On Click event to yourMacroName.SUB1

9. Save the form and test it.
 
Thanks. I am not that savvy, but I would try to learn the procedure
 

Users who are viewing this thread

Back
Top Bottom