Where is the code for application start?

MrNooby

Registered User.
Local time
Today, 13:19
Joined
Feb 21, 2010
Messages
58
Where can i enter some code which is used when application starts? I tried On form load and form open but that's to late...
 
Create a macro with the name Autoexec. This will run first when the application opens. The macro can either do your startup checks or call a VBA function which do what you want done before the application starts.

Hope this helps

JR
 
Last edited:
This will probably do it. I will try, but how can i call some code from macro?


For test I now just added MsgBox and tested it and still it's to late. If I hold SHIFT button when application starts this autoexec doesn't run.
 
If I hold SHIFT button when application starts this autoexec doesn't run.

That's correct, Shift bypasses any startup code/forms

but how can i call some code from macro

Under macroAction select RunBasic code and under fuctionname type: =StartUp()

Code:
Function StartUp()
 
If some test fails Then
   MsgBox " Critical Error, application will close"
   Docmd.Quit
Else: DoCmd OpenForm "Startup form"
End If

JR
 
That's correct, Shift bypasses any startup code/forms
So is there any way around that or all access applications can be accessed "back-end" like this?

What code are you attempting to run?
To check if CTRL is pressed, just like I have in code when application is already running.
 
If you are wanting to restrict access to the backend file for your application, you would need to place the Backend file on a network location and restrict access to that network location to everyone except your database users. You could also pasword protect it and have your front-end file be able to access the data even with the password in place on the backend. This is a lot of hassel if you do have to do it. I would try the network restrictions first.
 
I can't use network application, because some users use it offline on their drive only.

So there's no way to intercept the SHIFT, what about locking forms/tables/reports (back end only - design) with password just like VBA code?
 
Your back end should only contain tables. All the rest should be in the front end which can be shift key disabled.
 

Users who are viewing this thread

Back
Top Bottom