Results 1 to 4 of 4
  1. #1
    alex188 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    6

    how to create a search for box?

    hello




    Trying to create a search box that searches in my data sheet, In every field (or! Only in a particular field).
    Like the default search box in datasheet view form.

    I tried to use a macro:search for next record.
    It works Only if my data is on the main form! But! My data sheet form is a subform.

    And I can not make marco works on a subform. I mean, my text box is on the MAIN form,and I need to search subform.

    Thanks to all who can help!
    Attached Thumbnails Attached Thumbnails snup.PNG  

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  3. #3
    alex188 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    6
    Thanks, but all that I can do, and I could not understand how it solves my problem.
    What I want to do is use a macro command "search for next record"

    Open another window of the query, that's not what I asked, what I want to do is use a macro to "search for next record," on the subform - that's all.

    Thank you very much for the help!

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    If all you want to do is find the next record, then here is some code that will do that. Attach this code to the onclick event for a command button. Make sure the command button is situated on the sub form.

    Code:
    Private Sub Command12_Click()
    On Error GoTo Err_Command12_Click
    
    
    
    
        DoCmd.GoToRecord , , acNext
    
    
    Exit_Command12_Click:
        Exit Sub
    
    
    Err_Command12_Click:
        MsgBox Err.Description
        Resume Exit_Command12_Click
        
    End Sub
    Be sure to rename your command button. Mine was named Command12

    Alan

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

Similar Threads

  1. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  2. Replies: 1
    Last Post: 10-24-2010, 04:01 PM
  3. Search for Record, create new if not existant
    By asmith in forum Programming
    Replies: 3
    Last Post: 09-28-2010, 11:31 AM
  4. create search form
    By Balen in forum Forms
    Replies: 0
    Last Post: 08-22-2010, 01:01 AM
  5. How do I create a name search ?
    By nightviperdark in forum Access
    Replies: 1
    Last Post: 11-23-2009, 09:53 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