I have
Code:
Private Sub Button_Save_Click()
If varBookingSaved = True Then
DoCmd.Close acDefault, Me.Form.Name, acSaveNo
Exit Sub
End If
Call tagMustComplete("MustComplete", Me.Form, Text_ShowTime2nd.BorderColor)
Dim Booking As NewBookingClass
Set Booking = New NewBookingClass
'booking details
Booking.MemoBooking = Me.Text_MemoBooking.Value
Booking.MemoSchool = Me.Text_MemoSchool.Value
Booking.MemoPerformer = Me.Text_MemoPerformer.Value
Booking.OrderDate = Date
Booking.YearID = Me.Combo_BookingYear.Column(0)
Booking.BookingDate = Me.Text_BookingDate.Value
Booking.ShowID = Me.Combo_Show.Column(0)
Booking.ShowName = Me.Combo_Show.Column(1)
Booking.ShowStatusID = Me.Combo_BookingStatus.Column(0)
Booking.PricePerStudent = Me.Text_PricePerStudent.Value
Booking.BookingMinimum = Me.Text_BookingMinimum.Value
Booking.EstimatedAttendance = Me.Text_Attendance.Value
Booking.SchoolID = Me.Text_SchoolsID.Value
Booking.TeacherName = Me.Text_TeacherName.Value
Booking.TeacherSurname = Me.Text_TeacherSurname.Value
Booking.TeacherEmail = Me.Text_TeacherEmail.Value
Booking.time1 = Me.Text_ShowTime1st.Value
Booking.time2 = Me.Text_ShowTime2nd.Value
Booking.time3 = Me.Text_ShowTime3rd.Value
Booking.time4 = Me.Text_ShowTime4th.Value
Booking.time5 = Me.Text_ShowTime5th.Value
Booking.TOHandlingID = Nz(TempVars!tmpto_id, 0)
Booking.TOHandling = Nz(TempVars!tmpto_fullname, "Office")
Booking.TOBonusID = Nz(0, 0)
Booking.TOBonusName = Nz("Temp Name", "Office")
Call Booking.SaveBooking
Booking.PrintOut
End Sub
It faults on call Booking.SaveBooking
Savebooking function baisically saves all the public variables in the class to a recordset (puts the variables into a table row)
However I get a runtime '3265' item not found in this collection
I guess I am calling it wrong - it is a public function within the class and shows when I type the dot after the object name "booking"
I tried () and call but both give me the error.