I am tring to open a recordset that allows pessimistic record locking. It returns the error "INVALID ARGUMENT" when running the "set rstSender..." line. The code will open the recordset if I remove the "dbPessimistic" from the statement (along with the commas).
Any help would be most appreciative.
' This creates the recordset
Dim dbs As Database
Dim sqlstr As String
' rstSender is declared as a public recordset
' The rstSender recordset is a based on the t_person table details
Set dbs = CurrentDb
sqlstr = "SELECT * FROM letter"
Set rstSender = dbs.OpenRecordset(sqlstr, dbOpenDynaset, , dbPessimistic)
Any help would be most appreciative.
' This creates the recordset
Dim dbs As Database
Dim sqlstr As String
' rstSender is declared as a public recordset
' The rstSender recordset is a based on the t_person table details
Set dbs = CurrentDb
sqlstr = "SELECT * FROM letter"
Set rstSender = dbs.OpenRecordset(sqlstr, dbOpenDynaset, , dbPessimistic)