Results 1 to 5 of 5
  1. #1
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88

    Create a Custom Search by RecNum to Jump to that Question

    Hello all. This is my issue:

    I have 2 text boxes that show me the current record number and the total records. BTW this is not the ID AutoNum.



    -One shows the current record:
    Name: txtCounter1
    Control Source (=[Form].[CurrentRecord])

    -The other:
    Name: txtCounter2
    Control Source (=Count([ID]))

    Can't figure out if there's a way to create a GoToRec based in one of those two text boxes. For example: If I want to search for question #44 then enter 44 click the button and the record shows.

    Thanks in advance.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    docmd.openform "fMyForm",,,"[id]=" & me.txtFindID

    or if in the form:
    me.filter = "[id]=" & me.txtFindID
    me.filterON = true

  3. #3
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by ranman256 View Post
    docmd.openform "fMyForm",,,"[id]=" & me.txtFindID

    or if in the form:
    me.filter = "[id]=" & me.txtFindID
    me.filterON = true
    Forgot to mention that the Unbound textbox to enter the number is named txtJumpSearch...This is what I did but did not work:

    Private Sub cmdJumpSearch_Click()
    Me.Filter = "[id]=" & Me.txtCounter2 & Me.txtJumpSearch
    Me.FilterOn = True
    End Sub

    txtCounter2 has the total number of record
    txtJumpSearch is the Unbound textbox to enter the number I need

    This is using a button to execute (cmdJumpSearch)

    PS, both txtCounter1 and txtCounter2 are bound to an expression each and cannot be used to enter numbers. Reason why I'm using txtJumpSearch textbox.

    Thanks for the help.

  4. #4
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by ortizimo View Post
    Forgot to mention that the Unbound textbox to enter the number is named txtJumpSearch...This is what I did but did not work:

    Private Sub cmdJumpSearch_Click()
    Me.Filter = "[id]=" & Me.txtCounter2 & Me.txtJumpSearch
    Me.FilterOn = True
    End Sub

    txtCounter2 has the total number of record
    txtJumpSearch is the Unbound textbox to enter the number I need

    This is using a button to execute (cmdJumpSearch)

    PS, both txtCounter1 and txtCounter2 are bound to an expression each and cannot be used to enter numbers. Reason why I'm using txtJumpSearch textbox.

    Thanks for the help.
    Bump! Bump!

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Let me see if I understand:

    You have 3 unbound text boxes on a bound form:

    txtCounter1 (this shows the current record you are on)
    Control Source (=[Form].[CurrentRecord])

    txtCounter2
    (this shows the total number of records in the form record source)
    Control Source (=Count([ID]))


    txtJumpSearch (unbound textbox to enter the number you want to go to)

    There is a button named "cmdJumpSearch" with code
    Code:
    Private Sub cmdJumpSearch_Click()
       Me.Filter = "[id]=" & Me.txtCounter2 & Me.txtJumpSearch
       Me.FilterOn = True
    End Sub
    So if Me.txtCounter2 = 100 (total number of records) and you want to go to record 44 (Me.txtJumpSearch), then
    Me.Filter = "[id]=" & Me.txtCounter2 & Me.txtJumpSearch
    that means
    Me.Filter = "[id]=" & 20044 ' (200 & 44) = 20044

    You want to go to record #20044 ????? It is greater than the total number of records.

    Why aren't you using
    Code:
    Private Sub cmdJumpSearch_Click()
        Me.Filter = "[id]=" & Me.txtJumpSearch
        Me.FilterOn = True
    End Sub

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

Similar Threads

  1. Replies: 2
    Last Post: 10-09-2016, 06:46 AM
  2. How create custom unique ID
    By Jessicahawk in forum Forms
    Replies: 4
    Last Post: 12-02-2013, 01:41 PM
  3. Create a custom ribbon
    By nick.h in forum Access
    Replies: 3
    Last Post: 03-15-2013, 02:12 PM
  4. multi custom search helpp
    By moslem14 in forum Reports
    Replies: 1
    Last Post: 02-16-2013, 12:55 PM
  5. custom Ribbon question
    By jscriptor09 in forum Access
    Replies: 0
    Last Post: 07-17-2012, 02:35 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