Refresh Report (1 Viewer)

T. McConnell

Registered User.
Local time
Today, 06:53
Joined
Jun 21, 2019
Messages
63
Hey all,
Ok, I am stuck again of course lol. I have my forms and reports working, however when I click on my button to load the report, the values of the fields from the form are updated to the report unless I save the record then go back to the record. I am trying to load all the values to the report from the form before saving the record.
I have tried to use the requery command on the main form to ensure all fields are updated before opening the report.
Example below is for the current button to load the Orders report, however no matter what combination I use, the report doesn't update with the values when it loads from the the click event.

Private Sub btnPrintOrder_Click()
DoCmd.OpenReport "Orders", acPreview, , "[JobID]=" & Me.JobID
End Sub

Thanks for any help :banghead:
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:53
Joined
Aug 30, 2003
Messages
36,118
Try this line first:

If Me.Dirty Then Me.Dirty = False
 

T. McConnell

Registered User.
Local time
Today, 06:53
Joined
Jun 21, 2019
Messages
63
pbaldy,
Thanks a million, that did it. :)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:53
Joined
Aug 30, 2003
Messages
36,118
Happy to help! If it's not clear, that forces a save of the displayed record.
 

KHallmark

Registered User.
Local time
Today, 03:53
Joined
Jul 11, 2019
Messages
12
You might want to add a save or close button to your main record entry and then click on the report. i have to click one of those or forward or back button to save the record. You can always go back with navigation buttons.
 

Users who are viewing this thread

Top Bottom