Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Question Unanswered: Combobox selecting All

    I have a combo box where I would like to select either by Month year or All.
    When I open the form and select from the combobox say 092003 the data shows correctly then I select all and the data shows all. but when I go back and select another month/year it still shows me all.
    How would I correct this.
    Code below.

    Thanks


    Row Source Type = Table/Query

    Row Source = SELECT [Earned Doctorates Institutions Workload Query].Workload FROM [Earned Doctorates Institutions Workload Query] UNION SELECT "(ALL)" FROM [Earned Doctorates Institutions Workload Query] ORDER BY [Earned Doctorates Institutions Workload Query].Workload;


    CODE =
    Dim Fltr1 As String

    Private Sub cboworkload_AfterUpdate()
    If cboworkload = "(all)" Then
    Fltr1 = ""

    Else
    Fltr1 = "[Workload] like '" & cboworkload & "' "

    End If

    Me.Filter = Fltr1
    Me.Requery
    Me.Refresh


    End Sub

    Private Sub Form_Open(Cancel As Integer)

    Me.Filter = ""
    Me.FilterOn = True
    Me.Requery
    Me.Refresh

    End Sub

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Have you tried Me.FilterOn = False when the user selects (ALL)?

    Have you also tried using the me keyword before cboworkload?
    All code ADO/ADOX unless otherwise specified.
    Mike.

Posting Permissions

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