creating and using a filter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JohnHo
    New Member
    • Feb 2009
    • 12

    #1

    creating and using a filter

    I am trying to use the filter method with a form

    Using the Access/VBA documentation I have created a filter which looks like this

    Code:
    me.filter = "lngCaseID = 18905"
    me.filter on = true

    this works fine.

    I have tried using the same method including a varible based on a control

    it looks like this

    Code:
    Me.Filter =  """lngCaseID = " & Forms.frmUrgentTriage1.tboCaseID  _ & """" 
    me.filter on = true
    or

    Code:
    thisFilter = """lngCaseID = " & Forms.frmUrgentTriage1.tboCaseID  & """" 
    
    me.filter = thisFilter
    me.filter on = true
    and neither works despite the fact that when I debug.print the string is the same string as if I hard coded it.

    any suggestions.

    thanks greatly!!
  • OldBirdman
    Contributor
    • Mar 2007
    • 675

    #2
    thisFilter = "lngCaseID = " & Forms!frmUrgent Triage1.tboCase ID
    Me.FilterOn = True

    Comment

    • JohnHo
      New Member
      • Feb 2009
      • 12

      #3
      creating and using a filter

      thanks - where is that secret kept?

      Comment

      • OldBirdman
        Contributor
        • Mar 2007
        • 675

        #4
        Access Help -> Filter Property

        Comment

        Working...