Requery subreport from subform (1 Viewer)

Jupie23

Registered User.
Local time
Yesterday, 21:10
Joined
Nov 9, 2017
Messages
90
Hi all,
I'm new here so I hope I don't do this wrong. I am self taught with Access and VBA and have been learning through trial and error and Google. I have created a database for work. It is split and there are 4 different front ends, each used by different people depending on their job. Some are data entry, some are quality control, some are research, etc. and have different needs.

I have a form with a subreport and a subform.

Form = frmMain
Subform=frmSQJunction
Subreport=rptSQJunction

The form displays the account info. The subreport displays the errors previously selected on the account from a junction table. The subform allows them to add additional errors via a multiselect listbox that saves to the junction table. I would like to click an "Add" button and have the subreport update to show the newly added errors as well. They appear there if I leave the record and go back, but I cannot figure out the proper syntax to requery the subreport from within the subform in the on click event. I hope I have explained it clearly. Any help is greatly appreciated. Thank you!
 

Jupie23

Registered User.
Local time
Yesterday, 21:10
Joined
Nov 9, 2017
Messages
90
Thank you for that. I am still not really sure which one to use because in the example, it sounds like subform 2 is on subform 1, and both of mine are on the main form. I tried a few of them, but I am not great with references. I need to work on that. The reason I used a subreport was because I wanted it to be a read only display. I couldn't get it to show multiple errors from the junction table for that record in one box without it looking like a datasheet. Is there a better way?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:10
Joined
Aug 30, 2003
Messages
36,125
I'd probably use a continuous form with the allow edits/additions/deletions all set to no. That said, try

Forms!frmMain.rptSQJunction.Report.Requery
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:10
Joined
Aug 30, 2003
Messages
36,125
Happy to help and welcome to AWF by the way!
 

Users who are viewing this thread

Top Bottom