I am opening an Access table record via VBA code in Excel and I want to 'lock' that record until it is updated by the Excel VBA code.
I have tested using the following
And both record objects execute when opened with no erro message.
Whilst testing I did do something where I got a message saying the record can't be opened as it is in use or something similar but I don't remember how I got this.
TIA
I have tested using the following
VBA Code:
Set rsQuery = CreateObject("ADODB.Recordset")
Set rsQuery2 = CreateObject("ADODB.Recordset")
strQuery = "SELECT SO_No FROM AllData WHERE SO_No= '" & strSO & "'"
strQuery2 = "SELECT SO_No FROM AllData WHERE SO_No= '" & strSO & "'"
rsQuery.Open strQuery, cnConnection, adOpenKeyset, adLockOptimistic
rsQuery2.Open strQuery, cnConnection, adOpenKeyset, adLockOptimistic
Whilst testing I did do something where I got a message saying the record can't be opened as it is in use or something similar but I don't remember how I got this.
TIA