Run-Time Error 3008

R

Robert

Error: "The table tblRequisition is already opened
exclusively by another user, or it is already open through
the user interface and cannot be manipulated
programmatically.

That's the error I am getting, and yes it is open by the
user interface through the current form frmDescription.
However, I need to be able to open a different form that
has an underlying query that is also based on the table
tblRequisition. The code I have written works except for
the error message. Any suggestions or should I quit and
start over by using a recordset or recordsetclone?

Your help is appreciated and I thank you in advace. Here
is my code...

Private Sub cmdViewReq_Click()
Dim strForm As String
Dim strWhere As String
strForm = "frmReqEdit"
strWhere = "ReqNum = '" & forms!frmDescription!ReqNum
DoCmd.OpenForm FormName:=strForm, WhereCondition:=strWhere
End Sub
 
A

Allen Browne

1. What setting do you have under:
Tools | Options | Advanced | Default record locking
"No locks" is generally the best strategy. Also known as "optimistic
locking", the lock is applied only during the write operation.

2. What setting do you have in the Record Locks of your form (Data tab of
the Properties box)? Again, "No Locks" is the best strategy.

3. Before you run this code, is it possible to save any edits to avoid a
conflict:
If Me.Dirty Then
Me.Dirty = False
End If
 
R

Robert

You are the man!!!

Yes I had mistakenly set RecordLocks on the property
sheet. Once corrected, the code completes its task. Thanks
again...
 

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