I have a dao.recordset
when I want to add a new record via rs.addnew I get an error "read only"
I know that the query is not read only and it works some of the time but now it has locked up and I don't know why?
Any suggestions?
I have a dao.recordset
when I want to add a new record via rs.addnew I get an error "read only"
I know that the query is not read only and it works some of the time but now it has locked up and I don't know why?
Any suggestions?
How did you open the Recordset?
Can you show all the related code?
OpenRecordset parms here
update - nothing to do with table, editable
my SQL is as follows
Code:SELECT tblSchools.NewSchoolsID, [p1]+Nz([p2],0)+Nz([p3],0) AS PaidTotal, tblSchools.SchoolName, tblTeacher.InvoiceNumber, CStr(Format([invoicenumber],"000000")) AS InvNum, tblTradingAs.GSTRegistered, tblGSTDivision.GSTDivisionNumber, tblJncTeacher.TeacherID, tblJncTeacher.BookingsID, tblTeacher.MergedName, tblShows.TheatreShow, tblTeacher.TeacherName, tblTeacher.TeacherSurname, tblTeacher.NewSchoolsID, tblTeacher.SchoolBookingMemo, tblTeacher.PaymentsID, tblTeacher.PaymentMethod1stID, tblTeacher.p1, tblTeacher.g1, tblTeacher.d1, tblTeacher.PaymentMethod2ndID, tblTeacher.p2, tblTeacher.g2, tblTeacher.d2, tblTeacher.PaymentMethod3rdID, tblTeacher.p3, tblTeacher.g3, tblTeacher.d3, tblTeacher.InvoiceMemo, tblStates.SchoolState, tblSchools.SchoolAddress, tblSchools.SchoolSuburb, tblSchools.SchoolPostCode, tblSchools.SchoolPhone, tblSchools.SchoolFax, tblSchools.SchoolEmail, tblSchools.BankID, tblSchools.BankBranch, tblTeacher.GSTOLD, tblBookings.BookingDate, tblTeacher.JoiningSchool, tblTeacher.JoiningDateRemoved, tblTeacher.JoiningSchoolStatusID, tblBookings.StatusID, tblTeacher.ActualStudentAttend FROM tblTradingAs RIGHT JOIN (tblStates INNER JOIN (tblShows RIGHT JOIN (tblSchools INNER JOIN (tblGSTDivision RIGHT JOIN (tblBookings RIGHT JOIN (tblTeacher LEFT JOIN tblJncTeacher ON tblTeacher.TeacherID = tblJncTeacher.TeacherID) ON tblBookings.BookingsID = tblJncTeacher.BookingsID) ON tblGSTDivision.GSTDivisionID = tblTeacher.GSTDivisionID) ON tblSchools.NewSchoolsID = tblTeacher.NewSchoolsID) ON tblShows.ShowsID = tblBookings.ShowsID) ON tblStates.StateID = tblSchools.StateID) ON tblTradingAs.TradingAsID = tblShows.TradingAsID WHERE (((tblSchools.NewSchoolsID)<>9389)) ORDER BY tblBookings.BookingDate;
??? you can check this by Allen Browne
Sorry found the faults, crazy day - some primary keys were not set!??? you can check this by Allen Browne
I have a problem with the code, on the form I have a class (made as a class object) but I get object not set
at the top of the form I have private Booking as newbookingclass which creates the object and then I set it when the form loads (I don't want it to have public access outside the form however I have changed it to public without much change happening)
it stops at updatebooking or savebooking which are functions in the form and save booking is a class action
my code for updatebooking is
baisically even though I have set the booking variable class object as newbookingclass when the form loads it still says the booking = nothing (in the function)Code:Private varBookingMinimum As Variant Private varBookingSaved As Boolean Public Booking As NewBookingClass Private Function updateBooking() 'booking details With Booking .MemoBooking = Me.Text_MemoBooking .MemoSchool = Me.Text_MemoSchool .MemoPerformer = Me.Text_MemoPerformer .OrderDate = Date .YearID = Me.Combo_BookingYear.Column(0) .BookingDate = Me.Text_BookingDate .ShowID = Me.Combo_Show.Column(0) .ShowName = Me.Combo_Show.Column(1) .ShowStatusID = Me.Combo_BookingStatus.Column(0) .PricePerStudent = Me.Text_PricePerStudent .BookingMinimum = Me.Text_BookingMinimum .EstimatedAttendance = Me.Text_Attendance .SchoolID = Me.Text_SchoolsID .TeacherName = Me.Text_TeacherName .TeacherSurname = Me.Text_TeacherSurname .TeacherEmail = Me.Text_TeacherEmail .time1 = Me.Text_ShowTime1st .time2 = Me.Text_ShowTime2nd .time3 = Me.Text_ShowTime3rd .time4 = Me.Text_ShowTime4th .time5 = Me.Text_ShowTime5th .TOHandlingID = Nz(TempVars!tmpto_id, 0) .TOHandling = Nz(TempVars!tmpto_fullname, "Office") .TOBonusID = Nz(getSchoolTOID(Booking.SchoolID), 0) .TOBonusName = Nz(Me.Text_BookerIDBonus, "Office") End With End Function
hmm I had to pass the object into the function as the same class so function updatebooking(booking as newbookingclass)
not sure why this fixed it