Access, List box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • margot
    New Member
    • Sep 2007
    • 48

    Access, List box

    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]
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags.

    [Code=vb]
    Dim strSelect As String
    strSelect = "Issue = '" & Me.frmOptionY & "'"
    DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
    End Sub
    [/Code]

    Comment

    • margot
      New Member
      • Sep 2007
      • 48

      #3
      Originally posted by Rabbit
      Please use code tags.

      [Code=vb]
      Dim strSelect As String
      strSelect = "Issue = '" & Me.frmOptionY & "'"
      DoCmd.OpenForm "qryIssue", acViewPreview, , strSelect
      End Sub
      [/Code]
      Thank you so much!!!

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Originally posted by margot
        Thank you so much!!!
        Not a problem, good luck.

        Comment

        Working...