Results 1 to 4 of 4
  1. #1
    kawi6rr is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    39

    Error 3622 - You must use the dbSeeChanges option with OpenRecordset

    I've searched many sites and have tried a few examples but can't get anything to work with what I'm doing and can't figure out how to get it to work with my code. I'm trying to open a recordset to read a value in a field and assign that value to a select list. I keep getting the same error listed in the title.

    Dim dbs As Database
    Dim rst As Recordset
    Set dbs = CurrentDb
    If (Not (IsNull(OccurrenceReportID))) Then
    '*** FALL TYPE START ***
    Set rst = dbs.OpenRecordset("Select dbo_Falls.OccurrenceReportID,dbo_FallOccurrenceTyp e.FallOccId,dbo_FallOccurrenceType.FallOccType FROM dbo_FallOccurrenceType INNER JOIN dbo_Falls ON dbo_FallOccurrenceType.FallOccId = dbo_Falls.FallOccId WHERE OccurrenceReportID =" & OccurrenceReportID)


    Do While (Not (rst.EOF))
    Select Case rst!FallOccId
    Case 1
    Me.cbo_FallOccType.Value = "Out-patient clinic/property"
    Case 2
    Me.cbo_FallOccType.Value = "In-patient at MOA"
    Case 3
    Me.cbo_FallOccType.Value = "ED"
    Case 4
    Me.cbo_FallOccType.Value = "Other area at MOA"
    End Select

    rst.MoveNext
    Loop
    rst.Close
    Set rst = Nothing
    End If

    Any help is appreciated, thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    What should 'assing' really be?

    Never seen that error.

    Why are you looping through recordset? Should this recordset return multiple records?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    kawi6rr is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    39
    assing = assign

    spelling error.

    Actually now that I think about it I don't need to loop through it but that does not change the fact that I'm still getting the error. The error happens on this line of code.

    Set rst = dbs.OpenRecordset("Select OccurrenceReportID,FallOccId,FallOccType from FROM dbo_FallOccurrenceType INNER JOIN dbo_Falls ON dbo_FallOccurrenceType.FallOccId = dbo_Falls.FallOccId WHERE OccurrenceReportID =" & OccurrenceReportID)

    Sorry I should have pointed that out first.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    That SQL is different from one in the OP. This one does not specify which FallOccID to pull in the SELECT clause.

    I see nothing wrong with the original SQL but I don't connect to many SQLServer backends and have never tried to open recordset with one. Maybe this helps http://weblogs.asp.net/gunnarpeipman...dentity-column or are these among the methods you already attempted?

    I would use Me! prefix to reference the form field or Me. to reference control.

    But why do you even need code to set a combobox value?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. dbSeeChanges does not fix openrecordset error
    By lringstad in forum Access
    Replies: 1
    Last Post: 12-03-2013, 03:33 PM
  2. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  3. Use dbseechanges option with openrecordset
    By spleewars in forum Programming
    Replies: 3
    Last Post: 05-22-2012, 04:19 PM
  4. Filtering OpenRecordset Form reference error
    By CaptainKen in forum Programming
    Replies: 3
    Last Post: 02-09-2012, 06:11 PM
  5. db.OpenRecordset error
    By jscriptor09 in forum Programming
    Replies: 4
    Last Post: 01-27-2012, 12:17 AM

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