Solved Print report from pop-up form

slharman1

Member
Local time
Today, 11:58
Joined
Mar 8, 2021
Messages
483
I have a pop-up form with option group and depending on the option I want to print a report for the current record on the form that called the pop-up form.
Can someone shown me how?
Thanks
 
You should test the value of the Frame. Note that each radio button represents an Index value of the frame.
 
Maybe I was not specific enough. I have a continuous form and when I click a command button I print a report based on the current record. Now I want a pop-up to open and based on my selection on the pop-up I want to print either the acknowledgment report, the work order report or the packing slip report for the current record on the continuous form.
 
I have already made the pop-up with the options and all. I just need to filter the the report based on the current record on the continuous form that called the dialog form.
 
I have already made the pop-up with the options and all. I just need to filter the the report based on the current record on the continuous form that called the dialog form.

Did you see my link? Instead of

Me.ControlName

You'd use the full reference to the continuous form:

Forms!FormName.ControlName
 
Did you see my link? Instead of

Me.ControlName

You'd use the full reference to the continuous form:

Forms!FormName.ControlName
Not sure how to select the record that was current before clicking the button that calls the dialog since it loses focus when clicking the button.
If I understand correctly when a dialog form closes the event calling it will continue to run, just not sure how all this works.
Thanks
 
depending on the option I want to print a report
This makes it sound like depending on the option (radio button) selected in the option group (which is a frame control), you want to conditionally do something.

Now you say it depends on another form's record, so I'm confused. The suggestion I posted would work based on what you first said?
 
Not sure how to select the record that was current before clicking the button that calls the dialog since it loses focus when clicking the button.
If I understand correctly when a dialog form closes the event calling it will continue to run, just not sure how all this works.
Thanks

Have you tried it yet? If the button is changing the selected record, you can save the ID into a variable and use that.
 
Pass the ID of the record on the continuous form to the popup form as OpenArgs and in the code that opens the report from the pop-up use the passed value in the Docmd.OpenReport Where: condition.

Cheers,
 
This makes it sound like depending on the option (radio button) selected in the option group (which is a frame control), you want to conditionally do something.

Now you say it depends on another form's record, so I'm confused. The suggestion I posted would work based on what you first sai
Pass the ID of the record on the continuous form to the popup form as OpenArgs and in the code that opens the report from the pop-up use the passed value in the Docmd.OpenReport Where: condition.

Cheers,
Ah cool, I didn’t know how to do that. Thank you.
 
Using a button on a parent form to take some action based on the "current" record of a subform is fraught with danger. Are you certain that you ALWAYS know what subform record is "current". If you press the button in the main form without ever moving focus to the subform, the "current" record will be the first row of the subform's recordset. If you set focus to the third record in the subform and than go back to the mainform to press the button, the third record of the subform should still be "current" but are you sure.

I always put buttons that act on the subform record ON the subform itself. If you are using a continuous subform, that is fine since you can add buttons but if the subform is in DS view, you can't use buttons so what to do? I use the double-click event of the ID field. That way, you ALWAYS know what record is current and you can pass the ID of that record to the form you are opening using the OpenArgs as bastanu suggested.
 

Users who are viewing this thread

Back
Top Bottom