Hi, I posted this question in the reports forum,but I think it belongs here.
I have a subform that has a command button that is used to open and run a report, only for the specific record shown. The problem is that when I press the command button the report shows behind the form so I can't see it. I've tried to make the form/subform invisiable but it doesn't work. The other reports that I have on a switchboard/reports menu form work fine. When I run those the reports menu form is hidden and the report is shown.
I basically want to hide both the main form and it's subform when the report opens, then when the report closes reopen/make them visable again.
The main form is named frmDivaProfile
the subform is named partnerLinkSubform
here's the code for the command button on the subform
Please help, thanks![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)
I have a subform that has a command button that is used to open and run a report, only for the specific record shown. The problem is that when I press the command button the report shows behind the form so I can't see it. I've tried to make the form/subform invisiable but it doesn't work. The other reports that I have on a switchboard/reports menu form work fine. When I run those the reports menu form is hidden and the report is shown.
I basically want to hide both the main form and it's subform when the report opens, then when the report closes reopen/make them visable again.
The main form is named frmDivaProfile
the subform is named partnerLinkSubform
here's the code for the command button on the subform
Code:
Private Sub cmdOpenrptDivaAssignments_Click()
On Error GoTo Err_cmdOpenrptDivaAssignments_Click
Me.Refresh
Dim stDocName, stlink As String
stDocName = "rptdiva_assignments_single"
stlink = "IDDiva = forms!frmDivaProfile!txtID"
DoCmd.OpenReport stDocName, acPreview
Me.DivaID.SetFocus
Me.Visible = False
Me.Refresh
Exit_cmdOpenrptDivaAssignments_Click:
Exit Sub
Err_cmdOpenrptDivaAssignments_Click:
MsgBox Err.Description
Resume Exit_cmdOpenrptDivaAssignments_Click
End Sub
Please help, thanks
![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)