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
Microsoft SQL ServerMicrosoft Access

Avatar of undefined
Last Comment
VeeVan
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
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
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
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo