I have a list box with different isssues and I would like that when the user selects one Issue a form will open with all fields but only that Issue. I used the code below, but it does not seem to work. My guess is that this might not be the way to do it. Can someone help?
Thank you.
[Code=vb]
Dim strSelect As String
Select Case frmOptionY
Case "ClassI"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassI' '"
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
Case "Class II"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassII' "
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
Case "Class III"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'Class III' "
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
End Select
End Sub
[/Code]
Thank you.
[Code=vb]
Dim strSelect As String
Select Case frmOptionY
Case "ClassI"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassI' '"
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
Case "Class II"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'ClassII' "
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
Case "Class III"
strSelect = "SELECT * FROM qryIssue WHERE Issue = 'Class III' "
DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
End Select
End Sub
[/Code]
Comment