R
Rhonda Fischer
Hello,
My subform is dependant on values entered by the user,
so I only want to make it visible after values entered.
How do I hide a subform and then unhide it on the click
of a command button. I found on trying to use the
following code that the subform was not recognised as
being opened so could not set attribute to hidden.
call HideAForm("[Forms]!frmOrderSheet!frmOrderSheetSub")
Sub HideAForm(myform As String)
'Close form if open so that it can be hidden
if currentProject.AllForms(myForm).IsLoaded = True then
DoCmd.Close acForm, myform
end if
Application.SetHiddenattribute acForm, myform True
End Sub
and then I used the following to make the subform visible
neither bits of code work?
Call UnhideAForm([Forms]!frmOrderSheet!frmOrderSheetSub")
Sub UnhideAForm(myForm as String)
If Application.GetHiddenAttribute(acForm, myForm) = True
then
Application.SetHiddenAttribute acForm, myForm, False
DoCmd.OpenForm myForm
end if
end sub
Any ideas on how I can hide my subform?
Thank you very much, I'm sure I've made it more complicated
than need be.
Cheerio
Rhonda
My subform is dependant on values entered by the user,
so I only want to make it visible after values entered.
How do I hide a subform and then unhide it on the click
of a command button. I found on trying to use the
following code that the subform was not recognised as
being opened so could not set attribute to hidden.
call HideAForm("[Forms]!frmOrderSheet!frmOrderSheetSub")
Sub HideAForm(myform As String)
'Close form if open so that it can be hidden
if currentProject.AllForms(myForm).IsLoaded = True then
DoCmd.Close acForm, myform
end if
Application.SetHiddenattribute acForm, myform True
End Sub
and then I used the following to make the subform visible
neither bits of code work?
Call UnhideAForm([Forms]!frmOrderSheet!frmOrderSheetSub")
Sub UnhideAForm(myForm as String)
If Application.GetHiddenAttribute(acForm, myForm) = True
then
Application.SetHiddenAttribute acForm, myForm, False
DoCmd.OpenForm myForm
end if
end sub
Any ideas on how I can hide my subform?
Thank you very much, I'm sure I've made it more complicated
than need be.
Cheerio
Rhonda