Go to next record command button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slenish
    Contributor
    • Feb 2010
    • 283

    #1

    Go to next record command button

    Hello all,

    What im trying to create is a command button that will go to the next record on a table, but its not quite as easy as it sounds :D

    What I have is a form where you can pull a record based on the criteria of 3 text boxes. Once you type that in a few other text boxes fill in with the information from the record on the table.

    Now sometimes there might be duplicate records matching the critera, this is where the button comes in. I want to make it where you can press the next button and it will then display the next record with the same matching criteria and then if i need to go back to the other record i was just looking at with a previous button.

    Appreciate any help with this

    thanks,

    Slen
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    There are too many unknown variable here to give you an answer.

    Is the form bound or unbound?
    What is the code that currently populates the fields?
    What is the query used to find the record(s)?

    Comment

    • slenish
      Contributor
      • Feb 2010
      • 283

      #3
      Hello MMcCarthy,

      The form is Unbound, the record is pulled using the DLookup function which is what im thinking I might have to use with the next record button. Other code running is a DCount to let you know there is duplicate records. There is no Querys.

      Hope that helps narrow down some things :D

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Because the form is unbound and you are using a dlookup I can't think of any way you could bind two records to the form at the same time so you will just have to code a dlookup on the next and back button.

        Comment

        • slenish
          Contributor
          • Feb 2010
          • 283

          #5
          That sounds like a plan to me problem is how would i get the Dlookup feature to look at the next record and display it? Any ideas?

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            I'm not sure, if your DLookup results in two records you have to find some way to distinguish between them.

            Comment

            Working...