Hiding a Form- help

  • Thread starter Thread starter Junior
  • Start date Start date
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
 
'cmd click on frm2

Private Sub cmdPrintList_Click()
Forms!frm1.Visible = False
Me.Visible = False
DoCmd.OpenReport "rpt2", acPreview, "", ""
 
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


.
.
 
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


.
 
Back
Top