nigelandrewfoster
Well-known Member
- Joined
- May 27, 2009
- Messages
- 747
Hello
The code stops at the highlighted line with Type Mismatch if I use oAttendee (or oGuest in the second block), but not if I use oDelegate:
Yet my Store class defines Hosts/NonHosts to seat as Attendees...
Any sharp eye spot the problem here? 'Cos I'm stumped!
Thanks very much for reading.
The code stops at the highlighted line with Type Mismatch if I use oAttendee (or oGuest in the second block), but not if I use oDelegate:
Code:
Private Sub Create_Attendees()
Dim oDelegate As Delegate
Dim oAttendee As Attendee
Dim oGuest As Attendee
Set oAttendees = New Attendees
For Each oDelegate In oDelegates
Set oAttendee = New Attendee
oAttendee.ID = oDelegate.ID & "a"
oAttendee.FirstName = oDelegate.FirstName
oAttendee.LastName = oDelegate.LastName
Set oAttendee.Store = oDelegate.Store
oAttendee.Role = oDelegate.Role
If oAttendee.Role = "host" Then
[B] oAttendee.Store.HostsToSeat.Add oAttendee, oAttendee.ID[/B]
Else
[B] oAttendee.Store.NonHostsToSeat.Add oAttendee, oAttendee.ID[/B]
End If
If oDelegate.GuestYN = "y" Then
Set oGuest = New Attendee
oGuest.ID = oDelegate.ID & "b"
oGuest.FirstName = ChristianName(oDelegate.GuestName)
oGuest.LastName = SurName(oDelegate.GuestName)
Set oGuest.Store = oDelegate.Store
oGuest.Role = "guest"
Set oAttendee.Guest = oGuest
If oAttendee.Role = "host" Then
[B] oAttendee.Store.HostsToSeat.Add oGuest, oGuest.ID[/B]
Else
[B] oAttendee.Store.NonHostsToSeat.Add oAttendee, oGuest.ID[/B]
End If
End If
Next
End Sub
Yet my Store class defines Hosts/NonHosts to seat as Attendees...
Code:
Option Explicit
Private pName As String
Private pNo As String
Private pRegion As Region
Private pHostsToSeat As Attendees
Private pNonHostsToSeat As Attendees
Public Property Get Name() As String
Name = pName
End Property
Public Property Let Name(Value As String)
pName = WorksheetFunction.Proper(Value)
End Property
Public Property Get No() As String
No = pNo
End Property
Public Property Let No(Value As String)
pNo = Trim(CStr(Value))
End Property
Public Property Get Region() As Region
Set Region = pRegion
End Property
Public Property Set Region(Value As Region)
Set pRegion = Value
End Property
Public Property Get HostsToSeat() As Attendees
Set HostsToSeat = pHostsToSeat
End Property
Public Property Set HostsToSeat(Value As Attendees)
Set pHostsToSeat = Value
End Property
Public Property Get NonHostsToSeat() As Attendees
Set NonHostsToSeat = pNonHostsToSeat
End Property
Public Property Set NonHostsToSeat(Value As Attendees)
Set pNonHostsToSeat = Value
End Property
Any sharp eye spot the problem here? 'Cos I'm stumped!
Thanks very much for reading.