G
Guest
I have a form called menu that runs at start up and on the onload event
properties of the form:
Private Sub Form_Load()
'==================================================
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Removes all Microsoft Access built-in toolbars.
'==================================================
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Sub
'END OF SUBROUTINE
Then I have a command button on the farm called exit:
Private Sub cmdRed_Click()
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Enable toolbars.
'==================================================
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i
DoCmd.Quit
End Sub
I use the same code from the on load event except I set the CommandBars
(i).Enabled = True
I do this so If I need to modifiy or design the database I can hold the
shift key down and access my menu. However I have to keep going in and
hitting the exit key until I can sucessfully get my menu back.
Question Is the DoCmd.Quit executing in some instances before the
CommandBars(i).Enabled = True is able to execute.
How can I get around this?
Thanks,
properties of the form:
Private Sub Form_Load()
'==================================================
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Removes all Microsoft Access built-in toolbars.
'==================================================
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Sub
'END OF SUBROUTINE
Then I have a command button on the farm called exit:
Private Sub cmdRed_Click()
'DATE: November 10, 2004
'AUTHOR: Todd L. Shillam
'COMMENTS:
'
'1) Enable toolbars.
'==================================================
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i
DoCmd.Quit
End Sub
I use the same code from the on load event except I set the CommandBars
(i).Enabled = True
I do this so If I need to modifiy or design the database I can hold the
shift key down and access my menu. However I have to keep going in and
hitting the exit key until I can sucessfully get my menu back.
Question Is the DoCmd.Quit executing in some instances before the
CommandBars(i).Enabled = True is able to execute.
How can I get around this?
Thanks,