REad only error

GreAppMat

New member
Local time
Today, 20:10
Joined
Nov 29, 1999
Messages
8
The below code is to simply compare an input by a user and see if it is a unique entry, if so then add it to a table. I keep getting the following message

Run time error 3027
"Can't Update. Database or object is read only"

Dim db As DATABASE
Dim rs As Recordset

strSQL = "tblPartInfo"

Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)


varCriteria = " PartNumber = " + PartNumber


rs.FindFirst varCriteria
Do While rs.NoMatch = True
rs.Edit
rs!PartNumber = PartNumber
rs.AddNew
Loop
DoCmd.Close
DoCmd.OpenForm "frmNewShortage"

rs.Close
End Sub
 
This is the line giving you the fit:
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)

You can only view record in "dbOpenSnapShot"

HTH
RDH
 

Users who are viewing this thread

Back
Top Bottom