Hi all, i'm trying to design a new Navigation Bar/Menu for my application to improve the navigation. Previously i was just using command buttons but now i want to try to use a combo box and place all the names of my forms in it.
I have setup a module:
and in one of my forms i have put the following calling code:
but when i try to use it, it doesnt work. nothing happens when i make any selection. But when i put all the code together in one form, it works..but its not feasible as if i were to add more forms in future it would cre8 lots of unnecessary code
any advice or answers much appreciated.
thanks
Eric
I have setup a module:
Code:
Public Sub Navigation_Menu(strCbxNavigateValue As String)
Select Case strCbxNavigateValue
Case "---Select---": 'do nothing since user must make a selection
Case "Main Menu": DoCmd.OpenForm "frmMainMenu"
Case "Search Request": DoCmd.OpenForm "frmReqSearch"
Case "Search Change Order": DoCmd.OpenForm "frmCOSearch"
Case "Exit Application": Auto_Compact_And_Exit
End Select
End Sub
Public Sub Auto_Compact_And_Exit()
If FileLen(CurrentDb.Name) > 6000000 Then '6 megabytes
Application.SetOption ("Auto Compact"), 1
Else
Application.SetOption ("Auto Compact"), 0
End If
pbooClose = True
DoCmd.Quit 'quit application after everything
Exit_AutoCompact:
Exit Sub
Err_Handler:
If Err.Number = 3078 Then
Resume Next
End If
MsgBox Err.Number & " - " & Err.description
Resume Exit_AutoCompact
End Sub
and in one of my forms i have put the following calling code:
Code:
Private Sub cbxNavigate_Click()
Dim strCbxNavigateValue As String
strCbxNavigateValue = Me.cbxNavigate.Value
Call Navigation_Menu("strCbxNavigateValue")
End Sub
but when i try to use it, it doesnt work. nothing happens when i make any selection. But when i put all the code together in one form, it works..but its not feasible as if i were to add more forms in future it would cre8 lots of unnecessary code
thanks
Eric