J
J.
Hello Everyone,
I'm new, so please be patient. I have a list box that is populated by a
test string. It's constant, so it never changes. My form has a
subform in it. I want to display a different subform for each lstIndex
of the lstBox. I'm perplexed. This is what I have tried:
'this is the strings
Const strText = "Test1, Test2" 'initialize string
Private Sub Form_Open(Cancel As Integer)
'fill the listbox, THIS WORKS!
lstItems.RowSource = strText
End Sub
Private Sub lstItems_Click()
'Change sub-form recordsource
If lstItems.ListIndex = 1 Then
'load
subFormFrame.Source = DoCmd.OpenForm("SubForm1", acFormView)
Else
'load
subFormFrame.Source = DoCmd.OpenForm("SubForm2", acFormView)
End If
End Sub
Any help for this newbie would be appreciated!
J
I'm new, so please be patient. I have a list box that is populated by a
test string. It's constant, so it never changes. My form has a
subform in it. I want to display a different subform for each lstIndex
of the lstBox. I'm perplexed. This is what I have tried:
'this is the strings
Const strText = "Test1, Test2" 'initialize string
Private Sub Form_Open(Cancel As Integer)
'fill the listbox, THIS WORKS!
lstItems.RowSource = strText
End Sub
Private Sub lstItems_Click()
'Change sub-form recordsource
If lstItems.ListIndex = 1 Then
'load
subFormFrame.Source = DoCmd.OpenForm("SubForm1", acFormView)
Else
'load
subFormFrame.Source = DoCmd.OpenForm("SubForm2", acFormView)
End If
End Sub
Any help for this newbie would be appreciated!
J