Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Listbox (Access 2000)

    Inmy form i have a list box with the following row source :
    SELECT [qryQuarterSales].[Customerid], [qryQuarterSales].[1], [qryQuarterSales].[2], [qryQuarterSales].[3], [qryQuarterSales].[4] FROM qryQuarterSales;

    In the OnCurrent event of the form i am trying to reduce the row source to the customerid chosen in the form. Can you help me ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Listbox (Access 2000)

    Try

    Private Sub Form_Current()
    Dim strSQL As String
    If Not IsNull(Me.CustomerID) Then
    strSQL = "SELECT CustomerID, [1], [2], [3], [4] FROM qryQuarterSales WHERE CustomerID = " & Me.CustomerID
    End If
    Me.lstSomething.RowSource = strSQL
    Me.lstSomething.Requery
    End Sub

    Replace lstSomething with the name of the list box.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •