Results 1 to 2 of 2
  1. #1
    Brian Foshee is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    11

    Help banging my head against a wall working on this

    I am working on a database to keep track of the computers in my company. I have a form that shows all the fields in the table. I can edit them delete them insert new ones. All that works fine on the form. I can also search using the built in search function but I dont really like it. So in the header section of my form I have an unbound textbox and two buttons one is filter the other is clear.

    Code:
     
    Private Sub cmdFilter_Click()
    Dim strWhere As String
    If Len(Me.txtSearch & vbNullString) > 0 Then
    strWhere = "([Location] Like """ & Me.txtSearch & "*"")"
    End If
    Me.Filter = strWhere
    Me.FilterOn = True
    Me.Requery
    End Sub
    This works fine I can type in a city name or part of it and it will filter the form to only show computers in our office in that city. However I want it to be able to filter anything. Say I know a serial number or I just want to see how many Dell pc's we have in our company I want to be able to type what ever information I know into that box and click filter and it show me the matches. Can someone please help me modify my code to allow for this. Thanks

  2. #2
    Brian Foshee is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    11
    found some help on some VB forums http://www.vbforums.com/showthread.php?t=617177 if anyone else ever comes across this issue.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. help queries is not working
    By ahmed-aljawad in forum Queries
    Replies: 3
    Last Post: 04-16-2010, 12:14 PM
  2. In over my head with a database class
    By fixittech in forum Database Design
    Replies: 3
    Last Post: 01-22-2010, 07:45 AM
  3. Why isn't this working?
    By adiecidue in forum Queries
    Replies: 4
    Last Post: 04-27-2009, 10:29 AM
  4. Query is not working
    By pushpm in forum Programming
    Replies: 3
    Last Post: 04-14-2009, 07:16 PM
  5. public instead of dim not working
    By DKY in forum Access
    Replies: 1
    Last Post: 10-14-2008, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums