Results 1 to 2 of 2
  1. #1
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74

    How Do I: Make Command Button Use Entry From Text Box.

    Hello Everyone..



    I do not know code at all really but what I want to do would probably be very simple.

    I have a form with hundreds of records and growing. I was asked if I could add a header to the top of the form with a textbox and a button. WHat needs to happen is a user would type in the number of the record they want to goto and when they click the button they would go straight to that record. Kind of like the Find record button but without the extra window.

    EDIT: I will mark this solved. I found I need to do this differently now.
    Last edited by RichardAnderson; 07-30-2013 at 10:38 AM.

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Try the code below. You could set this as your 'After Update' event on the text box where you enter the record number, or make it your button command 'On Click'

    Code:
        Me.FilterOn = False
        Me.Filter = "[RecordFieldNameHere] Like '*' &[Forms]![YourFormNameHere]![RecordNumberTextBox] & '*'"
        Me.FilterOn = True
        Me.Requery

    EDIT:

    If you do not want the wild cards on either side, simply delete the '*' and & from either side of the form call

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

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2013, 11:07 AM
  2. Replies: 0
    Last Post: 02-17-2013, 11:17 PM
  3. Populate text boxes with a command button
    By Brian62 in forum Forms
    Replies: 3
    Last Post: 09-30-2011, 12:52 PM
  4. Replies: 1
    Last Post: 09-20-2011, 05:57 AM
  5. Replies: 7
    Last Post: 01-12-2011, 01:41 PM

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