Results 1 to 6 of 6
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Recordset readonly on rs.addnew

    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?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740
    How did you open the Recordset?
    Can you show all the related code?

    OpenRecordset parms here

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    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;

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by orange View Post
    Sorry found the faults, crazy day - some primary keys were not set!

    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

    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
    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)

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error on AddNew to an empty recordset
    By kowalski in forum Programming
    Replies: 7
    Last Post: 05-22-2013, 06:17 PM
  2. Using Recordset rst.AddNew
    By dandoescode in forum Programming
    Replies: 1
    Last Post: 06-06-2012, 10:10 AM
  3. Setting Record Readonly
    By ganeshvenkatram in forum Access
    Replies: 3
    Last Post: 06-23-2011, 07:36 PM
  4. Control linked to subform is readonly
    By degras in forum Forms
    Replies: 1
    Last Post: 11-23-2010, 09:21 PM
  5. readonly password protect
    By mlgehle in forum Security
    Replies: 1
    Last Post: 03-13-2010, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums