Very First Step In Launching an Application?

timo1999

Registered User.
Local time
Today, 02:01
Joined
Aug 31, 2009
Messages
13
I just recently upgraded from Access 97 to 2007. Our department inherited and application program programmed in Access (user interface for extracting specific data) that was programmed by somebody else using lots of VBA code.

There are only 2 things suprisingly that are not functioning 100%. What I would like to know is what is the first command that happens when I double click the application to launch it. One issue I have is a form is launched that I always have to close out before I can use the application properly.

I want to see if I can either remove that pesky form from lauching or moving it down later in the sequence so I don't have to close it everytime.

Also, I placed the application and supporting files in the "Trusted Location", but I am still asked to "enable" the file before I can launch it.

I have about 3% knowlege of VBA programming BTW.
 
What I would like to know is what is the first command that happens when I double click the application to launch it. One issue I have is a form is launched that I always have to close out before I can use the application properly.
Check to see if you have a macro named AutoExec. If you do that is what is run very first before anything else. If you don't then you need to go look under the Office Button > Access Options > Current Database > and find the startup form which then might have code on it.


Also, I placed the application and supporting files in the "Trusted Location", but I am still asked to "enable" the file before I can launch it.
Make sure when you do this that you also remember to check the INCLUDE SUBFOLDERS checkbox.
 
There is no AutoExec, but I did find the first step using the other method you gave me. It turns out that the very first form that is set to launch is actually the form that I am trying to stop from popping up. I changed the start up to begin with the other form I want to see first, and that worked ONLY, the application won't quite launch. I guess there is some type of hidden code is launched in the original form that allows the second form to work. I'm not really sure how to check that. Any ideas?
 
I guess there is some type of hidden code is launched in the original form that allows the second form to work. I'm not really sure how to check that. Any ideas?

Go into the form in design view and then go to the menu (or Ribbon on 2007/2010) and use VIEW > CODE
 
Would it be OK to remove the second part of the code in red? I think this will make it work but am not sure if it is important.


_______________________________________________________________________
Option Compare Database 'Use database order for string comparisons
Option Explicit
_______________________________________________________________________
Private Sub cmdOK_Click()
DoCmd.Close acForm, Name
End Sub

_______________________________________________________________________
Private Sub Form_Open(Cancel As Integer)
If IsNull(OpenArgs) Then
DoCmd.OpenForm "frmCover"
DoCmd.Restore
If attachmentsOK Then
If versionsOK Then
Forms!frmCover!cmdBrowse.Enabled = True
Forms!frmCover!cmdImport.Enabled = True
Forms!frmCover!cmdReport.Enabled = True
Forms!frmCover!cmdFilter.Enabled = True
Forms!frmCover!cmdExport.Enabled = True
Forms!frmCover![lstTrainType].Enabled = True
Forms!frmCover![lstTrainType].SetFocus
End If
End If

If CurrentDb().Properties("StartupShowDBWindow") = False Then
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show Status Bar", False
Application.MenuBar = "mbrBlank"
Application.ShortcutMenuBar = "mpuCCP"
Else
Application.SetOption "Show Hidden Objects", True
Application.SetOption "Show Status Bar", True
Application.MenuBar = ""
Application.ShortcutMenuBar = ""
End If
DoCmd.Close acForm, Name
End If
End Sub
 
Would it be OK to remove the second part of the code in red? I think this will make it work but am not sure if it is important.
If you remove the code in red then your OK button on the form will not work.

In the OPEN event - it opens up a form called "frmCover" and then enables some controls on that form.

The second part of the OPEN event then sets some options for the database which look like they should be there.
 
I see, that does make sense even though I don't understand the code that well. It would be OK if the click was not working if I deleted that piece, however I just don't need for that form to open up at all. What I really want is for the "formCover" to be launched first instead of "frmStartUp" but that did not work when I changed the order.

Thanks for your help. I guess I am stuck on this, but maybe later on after trying to figure out more VBA, I will post another question that makes sense to real users of
VBA.
 

Users who are viewing this thread

Back
Top Bottom