Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    72

    Unanswered: Filter by using a combobox as value list?

    The form Skillcent displays self-described skills considered central to a person's job. The record source of this form is a query that takes info from more than one table.
    Because the skills are self-described they can be a few words long, hence I have a combobox that uses a value list to show
    Architecture
    Planning
    Design
    Urban
    Transport

    and I want the AfterUpdate event of the combo box to apply a filter to show records that contain anything like the term selected e.g. selecting "Design" would show Designing Education Programmes and Urban Design. I can't get this to work properly.

    Code:
    Private Sub ComboSkills_AfterUpdate()
    Me.Filter = Select * from Me.Prof_exp where & " LIKE '*" & ComboSkills & "*'"
    Me.FilterOn = True
    End Sub
    I have got the other forms working well with combo boxes but they are exact matches to the value in the combo box and so they are set up differently and work with

    Code:
    Private Sub ProfexpCombo_AfterUpdate()
    Me.Filter = "[PROFEXPID]=" & ProfexpCombo
    Me.FilterOn = True
    End Sub

  2. #2
    Join Date
    Jul 2007
    Posts
    72
    Okay, wouldn't you know it. I've been messing with that all day and as soon as I write to the forum I try:

    Code:
    Private Sub ComboSkillcent_AfterUpdate()
    Me.Filter = "[K_Skillcent].[Prof_exp]" & " LIKE '*" & ComboSkillcent & "*'"
    Me.FilterOn = True
    End Sub
    and that does it!

Posting Permissions

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