View Full Version : automatic launch


stalw
01-06-2002, 01:32 AM
i have created two databases which need to be launched on different days on startup.
DatabaseA on wednesday
DatabaseB on Thursday
Is there a way of doing this by creating a third database which will automatically launch databaseA or B depending on the system day.
Thanks

Fornatian
01-06-2002, 07:03 AM
It would be better in a VB application but this will work:

1.Build a new db with 1 form called 'Form1'
2.Set your startup options to load 'Form1'
3. Put this code in OnOpen event of Form1:

Dim stFilePath As String
If WeekDay(Date) = 4 Then
stFilePath = "WednesdayFilePath"
ElseIf WeekDay(Date) = 5 Then
stFilePath = "ThursdayFilePath"
Else
'do nothing
End If

If stFilePath <> "" Then
Application.FollowHyperlink stFilePath
DoCmd.Quit

I'm sure this can probably be done using a bat file but I don't know how to do it.

Ian