ahmedjamalaboelez
Ahmed J. Aboelez
- Local time
- Today, 16:02
- Joined
- Feb 25, 2015
- Messages
- 79
Good Day Access World
I want to refer to sub form inside the form class so It can be easy not to edited multi lines in every for
Following code I use but giving error that VBA not recognize sub form
Then when I want to call function in sub form or ask sub form to requery
On compiling code no errors
but when i run the form following error comes to me
Any help appreciated
Thanks
A.J
I want to refer to sub form inside the form class so It can be easy not to edited multi lines in every for
Following code I use but giving error that VBA not recognize sub form
Code:
' Define Current Form And Sub Form
Dim CurrentForm As Form
Dim HeaderSubForm As SubForm
Dim LinesSubForm As SubForm
'--------------------------
Dim CurrentFormName As String
Dim HeaderSubFormName As String
Dim LinesSubFormName As String
Code:
' On Even Form Open
CurrentFormName = "FrmDatabases"
HeaderSubFormName = "sub_databases_view"
LinesSubFormName = "sub_dbconnections_view"
Set CurrentForm = Forms(CurrentFormName)
Set HeaderSubForm = CurrentForm!SubForms(HeaderSubFormName)
Set LinesSubForm = CurrentForm!SubForms(LinesSubFormName)
Then when I want to call function in sub form or ask sub form to requery
Code:
'Call Function in subform
Forms!CurrentForm!HeaderSubForm.Form.ReloadMe
'Call Sub Form Recuery
CurrentForm!HeaderSubForm.Requery
'Setfocus
CurrentForm!HeaderSubForm.SetFocus
On compiling code no errors
but when i run the form following error comes to me
Any help appreciated
Thanks
A.J