Link to home
Start Free TrialLog in
Avatar of VeeVan
VeeVan

asked on

SQL DB Error on Setting Form recordset in Access

I have a challenge with an Access program. I have a SQL backend, and I have one form (just one) that is causing an error:

    Dim strLogon As String
    Dim strSQL As String
    Dim rstRS As Recordset
   
    strLogon = Me!Logon
    strSQL = "SELECT * FROM tblUsers ORDER BY UserInitials"
   
    Me.RecordSource = strSQL
    Set rstRS = Me.Recordset.Clone
    rstRS.FindFirst "[Logon] = '" & strLogon & "'"
    Me.Bookmark = rstRS.Bookmark
       
    DoCmd.GotoRecord acActiveDataObject, , acNext
    Me.AllowAdditions = False
    Me.AllowEdits = False
   
    Form_Refresh

The line that causes the error is here:

    Me.RecordSource = strSQL

I get an error about using dbSeeChanges when using OpenRecordset in a table that has an identity column. Now the REALLY weird part is that my table doesn't HAVE an identitiy column. I am totally unsure of what is causing this issue.

The error is coming from SQL, and then it proceeds with all my other code.

Any help would be greatly appreciated.

Thanks.
Vee
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VeeVan
VeeVan

ASKER

EE now allows you to post to multiple areas and since the database is designed in SQL, i wanted to post it here as well. SQL is generating the error, and I can't figure out why, since there is no identity column in the table.

Go figure. Thank you for the input, though.
Hmmmm....
Avatar of VeeVan

ASKER

Well ::insert sheepish grin:: I had a subform on my form that accessed a table that DID have an identity column, and doh, it was NOT using SeeChanges, so the error was actually correct. Sorry, and thanks for anyone who actually read the question.

V