Maj_Tom
asked on
Execution Error at DoCmd.OpenForm
Hi folks. I have a problem that I need some help with. I've built a database (my first) for use in the office. The database has a couple functions, one of which allows the creation edits of worker performance and then allows the worker to view their own (and only their own) edits. Split database in Access 2003.
Everything works fine for me as well as for me posing as another user. However, at a certain point it breaks when an actual users tries to run it. Specifically (it seems) at the DoCmd.OpenForm step. This happens both to the person trying to create the edit and the user trying to view their edit. All of the switchboard functions work for the users up to this point. The problem did not surface until I split the database.
The error is There was an error executing the command.
Here is the code (partial) opening an edit form:
****
'
' Open a form in Browse mode.
'
Case conCmdOpenFormBrowse
Select Case intSWBDID
Case 2 ' This is the Hearings switchboard
If intAccLvl > 2 Then ' Check for access greater than BAA
Debug.Print "Opening an hearing in edit mode"
DoCmd.OpenForm rs![Argument], , , , acFormEdit
Else
MsgBox "Sorry. You do not have access to this option."
End If
Case 4, 8, 9, 11, 12 ' Opening a case edit in edit mode
If intAccLvl > 3 Then ' Check for access of Lead or greater to edit
Debug.Print "Opening an edit in edit mode: "; rs![Argument]
DoCmd.OpenForm rs![Argument], , , , acFormEdit
Else
MsgBox "Sorry. You do not have access to this option."
End If
Case 17 ' Worker opening a case edit done on them as read only
' Open the form with a filtered record set
' The form is locked in the On_Current event
Select Case rs![Argument]
Case "BAA_EDITS"
Debug.Print "Line prior to the do.Cmd for opening the form "
DoCmd.OpenForm rs![Argument], acNormal, "qryMY_BAA_EDITS", , , acFormReadOnly, acWindowNormal
Debug.Print "Opening BAA_EDITS as locked", strUserID, intAccLvl
Case "CRIMINAL_EDITS"
Debug.Print "Line prior to the DoCmd for opening the form "
DoCmd.OpenForm rs![Argument], acNormal, "qryMY_CRIMINAL_EDITS", , , acFormReadOnly, acWindowNormal
Debug.Print "Opening CRIMINAL_EDITS as locked", strUserID, intAccLvl
Case Else ' Any other command is unrecognized
MsgBox "Unknown option."
End Select
****
Ive inserted a boat-load of debugs to try and trackthe problem down. The process executes through this: Debug.Print "Line prior to the DoCmd for opening the form ". Why would this break for a user at this point but work for me?????
Everything is set to allow sharing and both the front end and back end live in the same folder on a shared network drive.
Thx in advance.
tom
Everything works fine for me as well as for me posing as another user. However, at a certain point it breaks when an actual users tries to run it. Specifically (it seems) at the DoCmd.OpenForm step. This happens both to the person trying to create the edit and the user trying to view their edit. All of the switchboard functions work for the users up to this point. The problem did not surface until I split the database.
The error is There was an error executing the command.
Here is the code (partial) opening an edit form:
****
'
' Open a form in Browse mode.
'
Case conCmdOpenFormBrowse
Select Case intSWBDID
Case 2 ' This is the Hearings switchboard
If intAccLvl > 2 Then ' Check for access greater than BAA
Debug.Print "Opening an hearing in edit mode"
DoCmd.OpenForm rs![Argument], , , , acFormEdit
Else
MsgBox "Sorry. You do not have access to this option."
End If
Case 4, 8, 9, 11, 12 ' Opening a case edit in edit mode
If intAccLvl > 3 Then ' Check for access of Lead or greater to edit
Debug.Print "Opening an edit in edit mode: "; rs![Argument]
DoCmd.OpenForm rs![Argument], , , , acFormEdit
Else
MsgBox "Sorry. You do not have access to this option."
End If
Case 17 ' Worker opening a case edit done on them as read only
' Open the form with a filtered record set
' The form is locked in the On_Current event
Select Case rs![Argument]
Case "BAA_EDITS"
Debug.Print "Line prior to the do.Cmd for opening the form "
DoCmd.OpenForm rs![Argument], acNormal, "qryMY_BAA_EDITS", , , acFormReadOnly, acWindowNormal
Debug.Print "Opening BAA_EDITS as locked", strUserID, intAccLvl
Case "CRIMINAL_EDITS"
Debug.Print "Line prior to the DoCmd for opening the form "
DoCmd.OpenForm rs![Argument], acNormal, "qryMY_CRIMINAL_EDITS", , , acFormReadOnly, acWindowNormal
Debug.Print "Opening CRIMINAL_EDITS as locked", strUserID, intAccLvl
Case Else ' Any other command is unrecognized
MsgBox "Unknown option."
End Select
****
Ive inserted a boat-load of debugs to try and trackthe problem down. The process executes through this: Debug.Print "Line prior to the DoCmd for opening the form ". Why would this break for a user at this point but work for me?????
Everything is set to allow sharing and both the front end and back end live in the same folder on a shared network drive.
Thx in advance.
tom
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I received enough information to allow me to track down the root problem. Thanks everyone, I'm a noob at this any every bit of help is appreciated.
Thanks for posting your findings.
<I may well be wrong but this seems to get back to read/write permissions on the drive itself.>
You are 100% accurate on this point.
In order to run a database, all users need full permissions on the folder that the database resides in order to write the .ldb file.
If the FE exists locally, the .ldb for the front-end will be written on the user's local computer.
Once the user opens a back-end table, the .ldb file for the back end will be written to the folder that the back-end resides in.
<I may well be wrong but this seems to get back to read/write permissions on the drive itself.>
You are 100% accurate on this point.
In order to run a database, all users need full permissions on the folder that the database resides in order to write the .ldb file.
If the FE exists locally, the .ldb for the front-end will be written on the user's local computer.
Once the user opens a back-end table, the .ldb file for the back end will be written to the folder that the back-end resides in.
ASKER
The error on both an editor machine and an edited person's machine is:
Runtime 2603. Don't have permission to run "BAA_EDITS"
The edited person's machine also had a popup saying that the record could not be locked
The highlited debug line is the DoCmd.OpenForm (probably the same for them all).
I may well be wrong but this seems to get back to read/write permissions on the drive itself. The odd thing is that the linked table can be manually opened from within the front end but not when executing the DoCmd.Open Form
tom