Hi,
I have a one main form in my database and several subforms, exactly the same size, that appear/dissapear depending on what user has selected from a tree view menu. The form works by hiding all the other subforms and only showing the subform of interest.
The code i use is
Function funSubformVisible(frm As Form, strRequestedSubform As String)
Dim ctl As Control
For Each ctl In frm.Controls
Debug.Print ctl.Name & " " & ctl.ControlType
If ctl.ControlType = 112 Then
If ctl.Name <> strRequestedSubform Then
ctl.Enabled = False
ctl.Visible = False
Else
ctl.Visible = True
ctl.Enabled = True
End If
End If
Next ctl
End Function
the trouble I'm having is that one of the sub forms contains a subdatasheet which locks a table that i need to run a process on. i dont want to mess about to much in code with the record sources as i am building this for someone else. It there anyway i can stop the subforms from loading untill I need them? I thought that the ctl.Enabled = false would be enough but its not.
Thanks in advance
I have a one main form in my database and several subforms, exactly the same size, that appear/dissapear depending on what user has selected from a tree view menu. The form works by hiding all the other subforms and only showing the subform of interest.
The code i use is
Function funSubformVisible(frm As Form, strRequestedSubform As String)
Dim ctl As Control
For Each ctl In frm.Controls
Debug.Print ctl.Name & " " & ctl.ControlType
If ctl.ControlType = 112 Then
If ctl.Name <> strRequestedSubform Then
ctl.Enabled = False
ctl.Visible = False
Else
ctl.Visible = True
ctl.Enabled = True
End If
End If
Next ctl
End Function
the trouble I'm having is that one of the sub forms contains a subdatasheet which locks a table that i need to run a process on. i dont want to mess about to much in code with the record sources as i am building this for someone else. It there anyway i can stop the subforms from loading untill I need them? I thought that the ctl.Enabled = false would be enough but its not.
Thanks in advance