Hi
I have a form called frmMenuMain which has button that opens frmReport. When the button is pressed, frmReport is opened, and then I do a me.visible = false to make frmMenuMain invisible.
When the user exits frmReport, I do a docmd.close, and then have the following code:
I would like to make this code into a subroutine where the form name is passed as a parameter. It would look something like this:
My question is, what command do I use to make the form visible, given a string with the form name? What should the xxxxxxxx.Visible = True line look like?
Also, is there a better way to do this? If form A calls form B, I want form A to be invisible until form B is done, and then become visible again.
thanks
I have a form called frmMenuMain which has button that opens frmReport. When the button is pressed, frmReport is opened, and then I do a me.visible = false to make frmMenuMain invisible.
When the user exits frmReport, I do a docmd.close, and then have the following code:
Code:
If CodeProject.AllForms("frmMenuMain").IsLoaded Then
Form_frmMenuMain.Visible = True
Else
DoCmd.OpenForm "frmMenuMain"
End If
I would like to make this code into a subroutine where the form name is passed as a parameter. It would look something like this:
Code:
Public Sub FormVisible(lFormName As String)
If CodeProject.AllForms(lFormName).IsLoaded Then
xxxxxxxxx.Visible = True
Else
DoCmd.OpenForm lFormName
End If
End Sub
My question is, what command do I use to make the form visible, given a string with the form name? What should the xxxxxxxx.Visible = True line look like?
Also, is there a better way to do this? If form A calls form B, I want form A to be invisible until form B is done, and then become visible again.
thanks