another session

S

seeker

I have a button on a form which is suppose to update a memo field and when I
choose this button the following error occurs:

Run-time error '3188' could not update; currently locked by another session
on this machine.

what other session is this? how can I determine this? this is the only
access database open on this machine.
 
S

seeker

the command button calls a function

Private Sub cmdAddSymptoms_Click()
AddSeverityToMonthlyNote MemberNumber, MonthDate
Me.Requery
End Sub

Function AddSeverityToMonthlyNote(ByVal MemNum As Integer, ByVal MonthDate
As Date)
Dim qryMonthlyNotes As String, rstMonthlyNotes As DAO.Recordset
Dim SeverityInSentence
'Dim MonthDate As Date
'MonthDate = "11/01/09"

qryMonthlyNotes = "SELECT * FROM MonthlyNotes " & _
"WHERE MemberNumber=" & MemNum & " AND MonthDate=#"
& MonthDate & "#;"

Set rstMonthlyNotes = CurrentDb.OpenRecordset(qryMonthlyNotes)

If rstMonthlyNotes.RecordCount <> 0 Then
SeverityInSentence = GetSeverityInSentence(MemNum)
rstMonthlyNotes.Edit
rstMonthlyNotes![MonthlyNotes] = SeverityInSentence &
Nz(rstMonthlyNotes![MonthlyNotes], "")
rstMonthlyNotes.Update
End If
End Function

the code throws the error at the line right before rstmonthlynotes.update.
the strings in that line are populated correctly. Thanks.
 
J

John W. Vinson

I have a button on a form which is suppose to update a memo field and when I
choose this button the following error occurs:

Run-time error '3188' could not update; currently locked by another session
on this machine.

what other session is this? how can I determine this? this is the only
access database open on this machine.

You're the other session.

If the memo field is currently open for editing on the form and you
simultaneously try to run an update query to edit it, Access can't tell who's
in charge - the form or the query; so it gives you this error.

Either close the form; or update the contents of the memo field directly in
the form. It might help if you post your code and indicate (if it's not
obvious) what edit you want to perform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top