I have a form that based on specific critieria shows data in a list box. I am wanting to use a subform as one of the criteira elements. Any thoughts? Below is the code:
Private Sub Frame0_Click() Dim strQuery As String Select Case Frame0 Case 1 strQuery = "SELECT [Membership Data].ID, [Membership Data].[Project Name], [Membership Data].[Membership Number], [Membership Data].[First Name], [Membership Data].[Last Name], [Membership Data].[Phone Number], [Membership Data].[Membership Type], [Membership Data].Associate, [Membership Data].Status FROM [Membership Data] WHERE [Membership Type] = 'Advantage'" Case 2 strQuery = "SELECT [Membership Data].ID, [Membership Data].[Project Name], [Membership Data].[Membership Number], [Membership Data].[First Name], [Membership Data].[Last Name], [Membership Data].[Phone Number], [Membership Data].[Membership Type], [Membership Data].Associate, [Membership Data].Status FROM [Membership Data] WHERE [Membership Type] = 'Advantage Plus'" Case 3 strQuery = "SELECT [Membership Data].ID, [Membership Data].[Project Name], [Membership Data].[Membership Number], [Membership Data].[First Name], [Membership Data].[Last Name], [Membership Data].[Phone Number], [Membership Data].[Membership Type], [Membership Data].Associate, [Membership Data].Status FROM [Membership Data] WHERE [Membership Type] = 'Business Advantage'" Case 4 strQuery = "SELECT [Membership Data].ID, [Membership Data].[Project Name], [Membership Data].[Membership Number], [Membership Data].[First Name], [Membership Data].[Last Name], [Membership Data].[Phone Number], [Membership Data].[Membership Type], [Membership Data].Associate, [Membership Data].Status FROM [Membership Data] WHERE Status Is Not Null " End Select If txtMemNumb <> "" Then strQuery = strQuery & " AND [Membership Number] = " & txtMemNumb & "" If cboProjectType <> "" Then strQuery = strQuery & " AND [Project Type] = '" & cboProjectType & "'"
lstReport.RowSource = strQuery End Sub
I am wanting to populate associate automatically within the list.
|