Results 1 to 2 of 2
  1. #1
    DavidMadge
    Guest

    Multiple field FindNext

    Hi again

    I've specified a multiple-field index in a table but can't see how to use FindNext to refer to both fields. I've tried a few possibilities but none have worked.

    Can it be done, and if so how ?

    Thanks
    David

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple field FindNext

    The FindNext method requires a criteria string. If you have a mutliple-field index, that doesn't mean you have to find on that index, although you can. Your FindNext could take the following form if you used the FindNext method of the recordset:

    <pre> rst.FindNext "Field1=" & somevalue _
    & " AND Field2=" & someothervalue</pre>


    Where Field1 and Field2 represent the field names in your index and somevalue and someothervalue represent the specific values for those fields that you want to find.

    If you used the DoCmd.FindNext, you have to start out with a FindRecord, which takes a criteria string, before you can use DoCmd.FindNext without an argument.

    <pre> DoCmd.FindRecord "Field1=" & somevalue & " AND " _
    & "Field2=" & someothervalue

    DoCmd.FindNext</pre>

    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •