Set start up folder in Access application?

  • Thread starter Thread starter Gary J. Dikkema
  • Start date Start date
G

Gary J. Dikkema

I have two application, each in it's location.

As clients will run both, is there a way to set the default start-up thru
code as they open each application?

TIA.
 
Gary said:
I have two application, each in it's location.

As clients will run both, is there a way to set the default start-up thru
code as they open each application?

TIA.

If by the 'default startup' folder you mean the active folder, you
could include the command

ChDir <your folder of choice here>

In any code that runs right when the application starts.

HTH

Chuck Cain
 
Thanks Chuck.

I'm trying to change the default startup folder and I see (in my test) that
this does not do that.

FWIW, I have a shortcut on the desktop and each application gets into the
right set of folders...

It's just I think I need to be more careful by setting it correctly in each
app.

Needless to say, now it's correct only ONCE. <VBG>

Thanks again!
 
Multiple Start-up Forms Solution

Start off by creating a new table (if your database has a backend, be sure this table is in the front end)

You will need to create two forms, drop a frame with two options on both forms. Both forms are going to save to information from the options into your table

On one of the forms, view the form properties and create an Event Procedure for OnLoad. In the event add the following code:

Private Sub Form_Load()
On Error GoTo Err_Form_Load

Select Case (Me![FrameName])
Case 1 'If Option 1
DoCmd.OpenForm "[YourMainFormA]"
Case 2 'If Option 2
DoCmd.OpenForm "[YourMainFormB]"
Case Else
MsgBox "An Error Has Occured Please Contact the Administrator" & Chr(10) & "Error: Invaild User Type", , "Error:"
End Select

DoCmd.Close acForm, "[ThisFormName]"

Exit_Form_Load:
Exit Sub
Err_Form_Load:
MsgBox Err.Description
Resume Exit_Form_Load
End Sub

Use this form as your start up form. What it will do is, on start-up, look at the last selected option and open the form based on that. Then it will close the option form.

You will use the Second form (the one WITHOUT the event procedure) to change your selection.

It is a bit complex, I use this code to go back and forth between 4 main pages and it works perfectly.

Hope it helps.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top