Access 2010 Visible Property having no effect

J

Jim Franklin

Hi,

I have an Acc2010 app where I open a report in Preview mode from a modal,
popup form. I don't want the form to be closed, but want it hidden while the
report is open.

At the moment I set the form Visible property to False in the command button
code which opens the report. This works fine. But when I set the
form.Visible property back to true in the report Close event, nothing
happens. No error, but the form doesn't reappear either.

Code is as follows. This works fine in Acc2003, so anyone know what I am
doing wrong?

Many thanks, as always,
Jim

Private Sub cmdTurnover_Click()
On Error GoTo Err_cmdTurnover_Click

Me.Visible = False
DoCmd.OpenReport "rpt_Turnover", acViewPreview
DoCmd.Maximize

Exit_cmdTurnover_Click:
Exit Sub

Err_cmdTurnover_Click:
MsgBox Err.Description
Resume Exit_cmdTurnover_Click

End Sub

Private Sub Report_Close()
On Error GoTo MyErr

Forms!frm_Menu_Reports.Visible = True

MyExit:
Exit Sub

MyErr:
MsgBox Err.Description
Resume MyExit

End Sub
 
D

David-W-Fenton

At the moment I set the form Visible property to False in the
command button code which opens the report. This works fine. But
when I set the form.Visible property back to true in the report
Close event, nothing happens. No error, but the form doesn't
reappear either.

Code is as follows. This works fine in Acc2003, so anyone know
what I am doing wrong?

I do that frequently, and it works fine. What's the code in your
OnClose event in the report?

Does A2010 allow you to open a report modally, i.e., with the
acDialog switch? If so, you could move the line setting the form
visible out of the report, but I don't have A2010 installed on this
machine to check if it supports acDialog in reports...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top