Link to home
Start Free TrialLog in
Avatar of jimjennings
jimjenningsFlag for United States of America

asked on

Receiving the error: There was an error executing the command

This database began using Access 2000.  In 2009, I upgraded to 2007 and because there was no need to buy copies for all PC's, put MS Access Runtime 2007 on the client PC's.  Everything ran perfectly until about 4-6 weeks ago when I made a major change to our inventory table by splitting it into a parent table and a child table as it should have been.

Because of this obviously queries and forms had to be updated.  Everything works perfectly on my PC but on the PC's using Runtime there are three forms that will not open.  The error message is: 'There was an error executing the command'

I use the basics of basic code.  For example the most elaborate my code gets is:

Private Sub RcvROInv_Click()
On Error GoTo Err_RcvROInv_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmRcvRO"
    stLinkCriteria = "[RONumber]=" & Me![RONumber]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_RcvROInv_Click:
    Exit Sub

Err_RcvROInv_Click:
    MsgBox Err.Description
    Resume Exit_RcvROInv_Click
   
End Sub

Which is basic.  The only other things I do are again simple things like:

Private Sub Actual_Weight_AfterUpdate()
Me.Weight = Me.Actual_Weight * 1.3
Me.WeightConversion = IIf(Me.Weight < 1, Round(Me.Weight * 16), Round(Int(Me.Weight + 0.9999999999)))
Me.WeightConversion = IIf(Me.Weight < 1, Me.WeightConversion, Me.WeightConversion * 16)
End Sub

I do not ever use macros and have made sure to compile the VB code before creating the distribution package.  I can say I've tried everything but obviously haven't because there has to be something I've missed and am hoping someone can help.

Thanks in advance!
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

After splitting the table, did you then also provide mainform/subforms to show those relationships? Or are you presenting that data in a different way?

Is RONumber a Numeric datatype? I'd assume it is, else you'd get a different error.

Does the form have any code in the Current, Open or Load events?

It's possible you have a corrupt form or forms, but first I'd make sure that the enduser machine is fully up to date, and I'd also make sure the Runtime they're using is the latest one available (you can't update the Runtime through the Microsoft Updates website, at least not reliably).
1. Are any of the "weight" values located in the new table?

2. Always try not to leave the default Object names, try to use a naming convention.
ex.: http://www.xoc.net/standards/default.asp
Field Name: CustomerID
Control Name: txtCustomerID
Sometimes there is confusion between the Field Name and the Control, when they have the same name.

3. LSM will probably clarify, but remember that Access 2007 presumes Windows XP or higher.
So if some users are using Office 2003 on Windows 2000, there may be issues...
I would try to make the runtime in the same environment as the users, for maximum compatibility...

;-)

JeffCoachman
Avatar of jimjennings

ASKER

I found the solution and now feel like the novice I am because it was such an obvious error.  The new tables were being mapped to my local drive and not being mapped as a network drive.  So the three forms that brought the error message "There was an error executing the command" could not find the necessary table(s).

It was not until I updated a report that used the new tables and then tried to print that report on a PC using runtime that I received a 'can not find ......' error message.  I knew then that there was a problem with the mapping, a problem I should have checked and verified as not an issue when the problem began.

So for anyone who has a similar issue in the future, make sure all tables are referencing a network drive and not a PC's local drive, no matter if that PC is one you use or you have dedicated as a 'server' PC.

Now to LSMConsulting and boag2000; I appreciate your attempt to help solve this issue.  I believe because I attempted to assure that everything had been checked and by providing a couple of examples of the type of simple code I use, unnessary focus went to those snipets of code as potential parts of the problem.  They were examples only and had nothing to do with this issue.  So my apologies to you for that confusion.

The attempt in my question post was to weed out and narrow down all possible scenarios in order to limit any back and forth in trying to diagose the problem.  Time is important to all of us and I certainly don't want to waste anyone's time.  Since I found this website/forum I've found it very useful.  I will search every way possible to find the answer to a question before deciding to ask a new question.  The first question asked was very successful.  I want to hide under my novice rock with this one.

At this point I do not know the best way to close this.  I would like to split the points between the two who offered suggestions for their trouble, but don't know enough how it works.
< Time is important to all of us and I certainly don't want to waste anyone's time.>
Not to worry, most Experts here have a pre-determined maximum. amount of time they will spend on a question.

As far as askers figuring out that they were going down the wrong path...

Trust me, it happens all the time.

AFAIC, if my solution did not solve the problem directly, then I won't accept any points.

There are grey areas.
Like if the Experts post lead you to a solution indirectly.

However, in this case, you fully explained what the real problem was, then you clearly explained the steps you took to resolve the issue.
This means that you can accept your own post as the solution.
;-)

Congratulations.

;-)

Jeff
Accept OP's own post (http:#a33434774) as it seems that they solved their own issue...
ASKER CERTIFIED SOLUTION
Avatar of ee_auto
ee_auto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial