Access Runtime Error

Tieval

Still Clueless
Local time
Today, 23:55
Joined
Jun 26, 2015
Messages
475
Hi,

I have a database that runs perfectly on a fully loaded Office 2013 System, it also runs perfectly when you run C:\db.accdb /runtime


When you put it on a machine installed with only the access 2013 runtime environment it fails to open with the message "There was an error compiling this function" The visual basic module contains a syntax error" "Check the code and then recompile it"

Any clues??
 
You are probably missing a library reference.
Without adding a load of debugging code it could be difficult to find without temporarily loading a full version of access (NOT office) onto the machine concerned.
 
Hi Minty,

Many thanks.

I have found the problem but have no idea how to fix it.

My vba references Microsoft Office 12 Object Library to use a file open option and on a full office system fails to compile at Me.FileList.Rowsource = ""

Any clues would be most welcome
 
Ok, I have now removed the option of opening multiple files (I had no real use for it anyway) and it now all compiles perfectly.

The unfortunate issue now is that the runtime pc now opens the welcome form as dictated by an autoexec and then fails big time.

"Execution of this application has stopped due to a runtime error."
"This application can't continue and will shut down"

The office pc runs perfectly in normal and runtime modes.
 
You will need to add some error checking to catch and display where it is falling over.
Start with each procedure you are calling/ form loading events etc.
 
Ok, it's easier than that, I just stop it doing anything and then it is OK.

Now I add back a timed event on 5000

Code:
Private Sub Form_Timer()
DoCmd.Close
DoCmd.OpenForm "Scan Data", acNormal, "", "", acNormal

End Sub

Quite simply I close the welcome form and open the next form and now I have the error back. To my mind it happens on the Close as the welcome form is still open.
 
I don't think you can close the form you are on from code without opening the other form first?
 
I have now replaced the timed event with a button and reduced the event to just close the form.

I have defined the form just to be safe:
Code:
Private Sub Command6_Click()
DoCmd.Close acForm, "Welcome", acSaveNo
End Sub

and it still crashes when I press the button:banghead:
 
I don't think you can close the form you are on from code without opening the other form first?

You can in the full version and running as a runtime version on an office system but I will try closing it in the open event of the other form.
 
I have now replaced the timed event with a button and reduced the event to just close the form.

I have defined the form just to be safe:
Code:
Private Sub Command6_Click()
DoCmd.Close acForm, "Welcome", acSaveNo
End Sub

and it still crashes when I press the button:banghead:
Add an error trap so that you can see the error on the runtime - it's the only way you'll see it.
 
Can you advise on this as I have not done it before and would like to be sure it's not also my error trap that has an error!
 
I distribute DB front ends that are used almost exclusively in a runtime environment and it's not uncommon to see errors that don't appear on my full version (Can be down to user privilage / admin rights etc.), hence error capture becomes essential.

Code:
Private Sub Command6_Click()

On Error GoTo Command6_Click_Error

DoCmd.Close acForm, "Welcome", acSaveNo

On Error GoTo 0
Exit Sub

Command6_Click_Error:

    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Command6_Click_Error of Form_Welcome"
 
and still no error, just the crash on the runtime pc, I have attached the database which should simply load a welcome screen and the button on the welcome screen causes the issues.

If you have a second to glance at it, it would be greatly appreciated.
 

Attachments

Many thanks, the database was developed in 32bit but the runtime computer is Windows 10 64 bit.

Can I just install the 32 bit runtime on this or does it need the 64 bit one?

If so, as I have installed the 64 bit, how do I get it off?
 
It's not Windows 64 bit that causes problems with API calls. It's the Office 64 bit edition. We had this sort of problem too and changing the API calls using the PrtSafe attribute solved it. The site I gave tells you how.

I'd be careful about trying a 32 bit runtime. I once installed the Access 2010 runtime on my Office 365 system and it turned my Access 2013 into a runtime system. I had to restore a backup to fix it, so if you try this be sure to do a backup first.
 
It is that call, I assumed it was not being called but obviously not. I deleted the module completely and now everything works happily.

Maybe it is a bit advanced for what I am trying to do. Is there an easy way to hide the main access window as my database is running entirely from pop-ups and looked a lot better without the background? That is all that the module was for.
 
The idea of the game was to distribute it for systems that did not have Office installed and therefore there was no great risk.

I removed 64 bit runtime and installed 32 bit runtime and everything is now perfect.

Many thanks for all the help.
 

Users who are viewing this thread

Back
Top Bottom