Karthikeyan082075
Programmer
I have 2 classes. i have a constant that decides on module that i am going to work. Based on the constant value, either of the 2 classes gets instiantiated. then i am trying to use the functions that i defined inside these classes. But when i try accessing the function, i am getting error message
"Object doesn't support this property or method: airSearch.find'
line (70) "airSearch.find()"
Can any one tell me what is the wrong in my code?
Code Snippet:
---------------------------------------------------------
MODULE = "A"
MODULE = "B"
Class MODULEAirSearchFactory
Private Sub Class_Initialize
MsgBox "air search"
End Sub
Function getAirSearch ()
If MODULE = "A" Then
Set getAirSearch = New AAirSearch
End If
If MODULE = "B" Then
Set getAirSearch = New BAirSearch
End If
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
Class AAirSearch
Private Sub Class_Initialize
MsgBox "hi"
End Sub
Public Function find ( )
MsgBox ("A air search being performed")
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
Class BAirSearch
Private Sub Class_Initialize
MsgBox "hi"
End Sub
Public Function find ( )
MsgBox ("B air search being performed")
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
'#########################################################
Set airSearch = New MODULEAirSearchFactory
airSearch.getAirSearch()
airSearch.find()
Thanks.
"Object doesn't support this property or method: airSearch.find'
line (70) "airSearch.find()"
Can any one tell me what is the wrong in my code?
Code Snippet:
---------------------------------------------------------
MODULE = "A"
MODULE = "B"
Class MODULEAirSearchFactory
Private Sub Class_Initialize
MsgBox "air search"
End Sub
Function getAirSearch ()
If MODULE = "A" Then
Set getAirSearch = New AAirSearch
End If
If MODULE = "B" Then
Set getAirSearch = New BAirSearch
End If
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
Class AAirSearch
Private Sub Class_Initialize
MsgBox "hi"
End Sub
Public Function find ( )
MsgBox ("A air search being performed")
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
Class BAirSearch
Private Sub Class_Initialize
MsgBox "hi"
End Sub
Public Function find ( )
MsgBox ("B air search being performed")
End Function
Private Sub Class_Terminate
'MsgBox Name & ": Goodbye, world!"
End Sub
End Class
'#########################################################
Set airSearch = New MODULEAirSearchFactory
airSearch.getAirSearch()
airSearch.find()
Thanks.