Forum Discussion

KakovostMDM's avatar
KakovostMDM
Copper Contributor
Aug 24, 2022
Solved

Search records by a single field

Hello   Is there a possibility of searching through records using only one specific field? Among many others, I have the following 2 fields that are causing me problems: Order ID (with primary k...
  • Karl_Donaubauer's avatar
    Aug 24, 2022

    Hi,

     

    In theory you should be able to set the focus to the ID field and set the OnlyCurrentField parameter of the FindRecord method to True.  As that would be too unreliable for me, I wouldn't use that but sth like:

     

    Docmd.OpenForm "YourForm", , , "[Order Id]=" & YourSearchReference

     

    or if you really want to see all records in the form and only go to the desired record:

     

    Docmd.OpenForm "YourForm"

    Forms!YourForm.Recordset.FindFirst "[Order Id] = " & YourSearchReference

     

    Servus
    Karl
    Access News
    Access DevCon

Resources