I'm trying to define a session object based on a form name which could then be refered to from another form. So far I've been able to declare the form name as a string when FORM A opens using the following code...
LetActiveForm() = "[Forms]![Form A]"
Module used......
Option Compare Database
Option Explicit
Private ActiveForm As String
Public Property Get GetActiveForm() As String
GetActiveForm = ActiveForm
End Property
Public Property Let LetActiveForm(ByVal vNewValue As Variant)
ActiveForm = vNewValue
End Property
I've then tried to use the declared string as an object in FORM B....
Dim ActiveFormObj As Object
Set ActiveFormObj = GetActiveForm()
ActiveFormObj.Field1 = ..........
I'm getting Type Conversion Errors on the last step. It's fairly clear that I can't set an object equal to a string however I haven't managed to find a way around this.
Any help would be appreciated.
Rgd's,
Dave
LetActiveForm() = "[Forms]![Form A]"
Module used......
Option Compare Database
Option Explicit
Private ActiveForm As String
Public Property Get GetActiveForm() As String
GetActiveForm = ActiveForm
End Property
Public Property Let LetActiveForm(ByVal vNewValue As Variant)
ActiveForm = vNewValue
End Property
I've then tried to use the declared string as an object in FORM B....
Dim ActiveFormObj As Object
Set ActiveFormObj = GetActiveForm()
ActiveFormObj.Field1 = ..........
I'm getting Type Conversion Errors on the last step. It's fairly clear that I can't set an object equal to a string however I haven't managed to find a way around this.
Any help would be appreciated.
Rgd's,
Dave