I'm cleaning up some old code that's been handled by several people, so the question I'm about to ask is probably some minor mistake that I'm just overlooking. But, I've been working on this for some time now, and just can't seem to find the error, so I apologize in advance for trivial-ness.
Here's the code I'm running. This is to initial a class and open a form to adding items to a lookup table.
When I click on the button to open this form, the program throws a compile error on the
It says the DataMembers variable has not been defined. I've looked all over this code and just can't see the error. New eyes on this would be much appreciated.
ribbons
Here's the code I'm running. This is to initial a class and open a form to adding items to a lookup table.
Code:
Option Explicit
Dim mvarCounty As String
Dim mvarCity As String
Dim mvarDealer As String
Dim WithEvents adoPrimaryRS As Recordset
Private DoingRequery As Boolean
Public Event MoveComplete()
Public Property Let Dealer(ByVal vData As String)
mvarDealer = vData
End Property
Public Property Get Dealer() As String
Dealer = mvarDealer
End Property
Public Property Let City(ByVal vData As String)
mvarCity = vData
End Property
Public Property Get City() As String
City = mvarCity
End Property
Public Property Let County(ByVal vData As String)
mvarCounty = vData
End Property
Public Property Get County() As String
County = mvarCounty
End Property
Private Sub Class_Initialize()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "SELECT DealerName, DealerCity, DealerCounty " _
& "FROM tb_Dealer_Info " _
& "ORDER BY DealerName ASC", db, adOpenStatic, adLockOptimistic
DataMembers.Add "Primary"
End Sub
Private Sub Class_GetDataMember(DataMember As String, Data As Object)
Select Case DataMember
Case "Primary"
Set Data = adoPrimaryRS
End Select
End Sub
When I click on the button to open this form, the program throws a compile error on the
Code:
DataMembers.Add "Primary"
It says the DataMembers variable has not been defined. I've looked all over this code and just can't see the error. New eyes on this would be much appreciated.
ribbons