Hello, I have tried to figure this out and I am just not getting it...:banghead:
I am trying to create an "onclick" event for a control in a "navigation menu" style subform that will change the source object in another subform control on the same main form. (similar to the new "navigation form" that Access provides)
I have a table TabNavigation which has fields "TabNumber" (number) "ButtonNumber" (number) "ButtonLabel" (text) and "FormName" (text). This goes to a query named "Nav_Tab1Q" which selects records that "TabNumber" = 1. This query is the record source for a subform named "Tab1SF" with the control "ButtonLabel".
Basically what I would like to happen is this, when the user clicks a row in the Tab1SF subform, say the button label of "person information", which in my table = TabNumber 1 and ButtonNumber 1, the form named = to the value in the FormName field will load into the subform control named SF2Cont. Example of form name would be "Nav_PersonInfoSF"
This is my attempt, I am a VBA novice or less than a novice....
Private Sub Tab1ButtonLabel_Click()
If [ButtonNumber] = Queries.Nav_Tab1Q!ButtonNumber Then
Forms!NavigationForm!SF2Cont.SourceObject = Nav_Tab1Q!FormName
End If
End Sub
I am trying to create an "onclick" event for a control in a "navigation menu" style subform that will change the source object in another subform control on the same main form. (similar to the new "navigation form" that Access provides)
I have a table TabNavigation which has fields "TabNumber" (number) "ButtonNumber" (number) "ButtonLabel" (text) and "FormName" (text). This goes to a query named "Nav_Tab1Q" which selects records that "TabNumber" = 1. This query is the record source for a subform named "Tab1SF" with the control "ButtonLabel".
Basically what I would like to happen is this, when the user clicks a row in the Tab1SF subform, say the button label of "person information", which in my table = TabNumber 1 and ButtonNumber 1, the form named = to the value in the FormName field will load into the subform control named SF2Cont. Example of form name would be "Nav_PersonInfoSF"
This is my attempt, I am a VBA novice or less than a novice....
Private Sub Tab1ButtonLabel_Click()
If [ButtonNumber] = Queries.Nav_Tab1Q!ButtonNumber Then
Forms!NavigationForm!SF2Cont.SourceObject = Nav_Tab1Q!FormName
End If
End Sub