• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

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
0
Maj_Tom
Asked:
Maj_Tom
  • 2
  • 2
  • 2
3 Solutions
 
Surone1Commented:
can you open all the linked tables on the client machine?
0
 
Surone1Commented:
it may be a network issue try opening the network shared folder from the client machine before trying to open the form
0
 
mbizupCommented:
Your first debugging step should be to disable error handling:

Tools -> Options -> General -> select Break On All Errors

This will allow you to see exactly where the code is failing, and give you an exact error number and message.

It is difficult to troubleshoot your error without knowing this information.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
Maj_TomAuthor Commented:
OK. It took a bit as I only have a few tester people with permissions to use the shared drive (controlled by the network folks) They need read/write permissions as well as basic access (write so they can lock a record). And I think there in my be much of the problem.

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
0
 
Maj_TomAuthor Commented:
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.
0
 
mbizupCommented:
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now