Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Location
    Grand Junction, Colorado
    Posts
    12

    Unanswered: Help w/ Command Button filter code

    I am a Newbie pretty well have the basics down but i don't understand vba code. To this point just been searching the posts for help, great posts and forum BTW. Can't find what I need to do with this code to make it work, this is day 3 on this. I got a start from the wizard and tried to mod here is what I have so far.

    Private Sub cmbSearchGo_Click()
    On Error GoTo Err_cmbSearchGo_Click

    Set myVar1 = txbProjectSearch

    DoCmd.ApplyFilter , "ProjectName like [myVar1]"

    Exit_cmbSearchGo_Click:
    Exit Sub

    Err_cmbSearchGo_Click:
    MsgBox Err.Description
    Resume Exit_cmbSearchGo_Click

    End Sub


    Keeps asking me for a paramiter.

    Thanks, John

  2. #2
    Join Date
    Apr 2004
    Posts
    173
    You may need to reference the contents of that text box rather than just the variable. I take it the parameter you're prompted for is the [myVar1].
    Also you probably could just say

    docmd.applyfilter , "ProjectName Like '" & txbProjectSearch & "'"

    Try it see if it works

  3. #3
    Join Date
    Oct 2004
    Location
    Grand Junction, Colorado
    Posts
    12
    Perfect thanks so much!!

Posting Permissions

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