Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2011
    Posts
    3

    Post Unanswered: access form filter code!

    i have created a form from scratch to display information from a table, the table shows people's IDnumber, their Name and their tax paying information (other thirty something columns). in the form i have a text box for the search critera and a comand button, i would like to filter the form by using the ID number and the Name so that when i input the id number it would and press the button it would filter out the information for that person only. this is the code i used

    Private Sub Command2_Click()
    If Me.Text0 = 10 Then
    Me.Form.Filter = "NAME = ""DA BREO, JOHN"""
    Me.Form.FilterOn = True
    End If

    this worked but i had to make a code for each person and there are over 850 people so naturally i got an error message saying the code is too large.
    could anybody give me a better code to use!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    is this an access problem or an oracle problem?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Quote Originally Posted by healdem View Post
    is this an access problem or an oracle problem?
    An access problem!

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Why don't you use:
    Code:
    Me.Filter = "IDnumber = " & Me.Text0
    Have a nice day!

  5. #5
    Join Date
    Sep 2011
    Posts
    3
    Quote Originally Posted by Sinndho View Post
    Why don't you use:
    Code:
    Me.Filter = "IDnumber = " & Me.Text0
    that works perfect thanx man much appreciated

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Tags for this Thread

Posting Permissions

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