calling a sub form bounbd to a form

kobiashi

Registered User.
Local time
Today, 15:52
Joined
May 11, 2018
Messages
258
hi, ive written an if statement to check if a sub form is open before requering it, but im having an issue with c alling the object, below is my if statement, what is the correct method of calling the sub form inside a form please.


Code:
If CurrentProject.AllForms("forms!FrmManHours.SubfrmManHours").IsLoaded Then
        Forms!FrmManHours.SubFrmManHours.Form.Requery
    Else
    End If
 
Dim f As Form
On Error Resume Next
Set f = [Forms]![FrmManHours]![SubFrmManHours].Form
IF Err Then
Msgbox "subform Not Open"
End If
Err.Clear
On Error Goto 0
 

Users who are viewing this thread

Back
Top Bottom