Good Morning everyone..
Ok i've come accross a weird problem.. lol
i have a countdown on 1 of my main startup forms, that checks to see if outlook is running if not then it'll auto start-it outlook, then when the counter gets to 0 it continues to load the main menu...
Now if i have a button on the form that shows only when all the checks are done, that button works fine using the inbuilt macro builder.. and opens the main menu..
However in VBA it doesnt show the main menu, in fact its like the main menu is hidden, however using the same commands..
it also does the same when the countdown ends..
Heres the Code:-
and heres the code from the macro builder..
i am stumped, as cannot work out why it'll do it manualy, however wont show it using vba, however other forms will load fine.. and yes the main menu has a lot more coding on it.. but i can have that open from buttons, or from main startup in Access...
Any Ideas??
PS. i included the copy of the VBA for the main menu.. yes it probably could be cleaned up, but at momment i'm still building it and been a long time since i've done a lot in VBA.. anyway its included if you think it might be the main menu...
Ok i've come accross a weird problem.. lol
i have a countdown on 1 of my main startup forms, that checks to see if outlook is running if not then it'll auto start-it outlook, then when the counter gets to 0 it continues to load the main menu...
Now if i have a button on the form that shows only when all the checks are done, that button works fine using the inbuilt macro builder.. and opens the main menu..
However in VBA it doesnt show the main menu, in fact its like the main menu is hidden, however using the same commands..
it also does the same when the countdown ends..
Heres the Code:-
Code:
Option Compare Database
Public Loops As Integer
Private Sub Form_Open(Cancel As Integer)
Me.TimerInterval = 1000
Form_Timer
CurrentDb.Properties("AllowShortcutMenus") = False
Call fSetAccessWindow(2)
Dim i As Integer
For i = 1 To CommandBars.count
CommandBars(i).Enabled = True
Next i
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
DoCmd.SelectObject acTable, , True
If (fIsAppRunning("Outlook")) = False Then
' If outlook is not running, open in..
RetVal = Shell("C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE", 1)
Me.Label0.Visible = False
Me.Label1.Visible = False
Me.Label3.Visible = True
Me.Label4.Visible = True
Me.ExitStarter.Visible = True
Exit Sub
Else
Me.Label0.Visible = False
Me.Label1.Visible = False
Me.Label5.Visible = True
Me.Label6.Visible = True
Me.ExitStarter.Visible = True
'MsgBox "Outlook is running"
End If
End Sub
Private Sub Form_Timer()
Static StartTime As Date
Dim SecondsToCount As Integer
SecondsToCount = 5 'Set this variable to the total number of seconds to count down
If Loops = 0 Then StartTime = Time
Min = (SecondsToCount - DateDiff("s", StartTime, Time)) \ 60
Sec = (SecondsToCount - DateDiff("s", StartTime, Time)) Mod 60
Me.TimeLeft.Caption = "Form will close in " & Min & ":" & Format(Sec, "00")
Loops = Loops + 1
If Me.TimeLeft.Caption = "Form will close in 0:00" Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmMenu", acNormal
End If
End Sub
and heres the code from the macro builder..
Code:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="[URL]http://schemas.microsoft.com/office/accessservices/2009/11/application"><UserInterfaceMacro[/URL] For="ExitStarter" Event="OnClick"><Statements><Action Name="OpenForm"><Argument Name="FormName">frmMenu</Argument></Action><Action Name="CloseWindow"><Argument Name="ObjectType">Form</Argument><Argument Name="ObjectName">DBStarter</Argument><Argument Name="Save">No</Argument></Action></Statements></UserInterfaceMacro></UserInterfaceMacros>
i am stumped, as cannot work out why it'll do it manualy, however wont show it using vba, however other forms will load fine.. and yes the main menu has a lot more coding on it.. but i can have that open from buttons, or from main startup in Access...
Any Ideas??
PS. i included the copy of the VBA for the main menu.. yes it probably could be cleaned up, but at momment i'm still building it and been a long time since i've done a lot in VBA.. anyway its included if you think it might be the main menu...