G
Guest
Hi All,
I am having a problem with a subform on a tab on a Main Form.
I cannot get any expressions or VBA of either the subform or the subform
controls to work.
I have searched and found no answer.
These did not work:
Forms![myMainFormName]![mySubFormName].Form![MyctlName]
Me![mySubFormName].[MyctlName]
Me![MyctlName]
Me.[MyctlName]
Me.MyctlName
Me!MyctlName
[mySubFormName]
[myMainFormName].[mySubFormName]
Forms![myMainFormName].[mySubFormName] etc., etc.
I have checked my spelling, my SourceObject, etc. I have references to OLE
Automation, DAO 3.6 Objects Library, ActiveX Data Objects 2.8 Library and
more.
I tried to use work around and use a calendar control to set a date in a
textbox, but I kept getting a error message.
Private Sub btnMarriageDate_Click()
Dim myNewDate As Long
Call myNewDatePicker(myNewDate)
Me!MarriageDate = myNewDate
End Sub
Public Function myNewDatePicker(myNewDate As Long)
Dim CalendarControl2 As Calendar
DoCmd.OpenForm "frmCalPick2" ' This form has the Calendar control
myNewDate = CalendarControl2.Value
End Function
My Function returns this error:
Error 91 Object Variable with Block Variable not set
I think I may be getting this error because I am not using my form name in
the Function, but that is the problem--I can't use the subformname and get it
to work with anything.
I would appreciate any help
Hunter57
I am having a problem with a subform on a tab on a Main Form.
I cannot get any expressions or VBA of either the subform or the subform
controls to work.
I have searched and found no answer.
These did not work:
Forms![myMainFormName]![mySubFormName].Form![MyctlName]
Me![mySubFormName].[MyctlName]
Me![MyctlName]
Me.[MyctlName]
Me.MyctlName
Me!MyctlName
[mySubFormName]
[myMainFormName].[mySubFormName]
Forms![myMainFormName].[mySubFormName] etc., etc.
I have checked my spelling, my SourceObject, etc. I have references to OLE
Automation, DAO 3.6 Objects Library, ActiveX Data Objects 2.8 Library and
more.
I tried to use work around and use a calendar control to set a date in a
textbox, but I kept getting a error message.
Private Sub btnMarriageDate_Click()
Dim myNewDate As Long
Call myNewDatePicker(myNewDate)
Me!MarriageDate = myNewDate
End Sub
Public Function myNewDatePicker(myNewDate As Long)
Dim CalendarControl2 As Calendar
DoCmd.OpenForm "frmCalPick2" ' This form has the Calendar control
myNewDate = CalendarControl2.Value
End Function
My Function returns this error:
Error 91 Object Variable with Block Variable not set
I think I may be getting this error because I am not using my form name in
the Function, but that is the problem--I can't use the subformname and get it
to work with anything.
I would appreciate any help
Hunter57