Hiding a Form- help

J

Junior

Using the below code to open frm2 from a click event on frm1



frm2 has an option (cmd button to print a report- rpt2) -

But, when the [rpt1] is opened [frm1] is made visible - (which i don't
want)

Have tried making [frm1] not visible in frm2 cmd click and in rpt2 open
event

but frm1 is still visible-

how can i hide frm1 when rpt2 is opened from frm2 ? thanks



'cmdbutton to open frm2 from frm1

Me.Visible = False

DoCmd.OpenForm "frm2", DataMode:=acFormEdit, WindowMode:=acDialog



'cmd click on frm2

Private Sub cmdPrintList_Click()

DoCmd.OpenReport "rpt2", acPreview, "", ""
Forms!frm1.Visible = False
Me.Visible = False
 
L

losmac

'cmd click on frm2

Private Sub cmdPrintList_Click()
Forms!frm1.Visible = False
Me.Visible = False
DoCmd.OpenReport "rpt2", acPreview, "", ""
 
J

John C.

THANKYOU! I was just getting ready to ask the same
question, your answer worked for me!
-----Original Message-----
'cmd click on frm2

Private Sub cmdPrintList_Click()
Forms!frm1.Visible = False
Me.Visible = False
DoCmd.OpenReport "rpt2", acPreview, "", ""

-----Original Message-----
Using the below code to open frm2 from a click event on frm1



frm2 has an option (cmd button to print a report- rpt2) -

But, when the [rpt1] is opened [frm1] is made visible - (which i don't
want)

Have tried making [frm1] not visible in frm2 cmd click and in rpt2 open
event

but frm1 is still visible-

how can i hide frm1 when rpt2 is opened from frm2 ? thanks



'cmdbutton to open frm2 from frm1

Me.Visible = False

DoCmd.OpenForm "frm2", DataMode:=acFormEdit, WindowMode:=acDialog



'cmd click on frm2

Private Sub cmdPrintList_Click()

DoCmd.OpenReport "rpt2", acPreview, "", ""
Forms!frm1.Visible = False
Me.Visible = False


.
.
 
J

Junior

1somac- thanks but that doesn't work for me- frm1 is still visible appears
to go away and then reappears..- could it be something happening because of
the 'WindowMode:=acDialog'



losmac said:
'cmd click on frm2

Private Sub cmdPrintList_Click()
Forms!frm1.Visible = False
Me.Visible = False
DoCmd.OpenReport "rpt2", acPreview, "", ""

-----Original Message-----
Using the below code to open frm2 from a click event on frm1



frm2 has an option (cmd button to print a report- rpt2) -

But, when the [rpt1] is opened [frm1] is made visible - (which i don't
want)

Have tried making [frm1] not visible in frm2 cmd click and in rpt2 open
event

but frm1 is still visible-

how can i hide frm1 when rpt2 is opened from frm2 ? thanks



'cmdbutton to open frm2 from frm1

Me.Visible = False

DoCmd.OpenForm "frm2", DataMode:=acFormEdit, WindowMode:=acDialog



'cmd click on frm2

Private Sub cmdPrintList_Click()

DoCmd.OpenReport "rpt2", acPreview, "", ""
Forms!frm1.Visible = False
Me.Visible = False


.
 

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