General discussion

  • Creator
    Topic
  • #2188982

    ‘Find’ on both form and subform

    Locked

    by adisha ·

    I have a Access 2003 form with a form and subform. Can anyone guide me on how to create a contextless find so the user can search both the form and subform. At the moment the find is defaulting to where command button or the cursor is positioned. To summarise, I would like to be able to search all fields on both form and subform.

    Many thanks for your help in advance.

All Comments

  • Author
    Replies
    • #3071012

      Reply To: ‘Find’ on both form and subform

      by adisha ·

      In reply to ‘Find’ on both form and subform

      Point value changed by question poster.

    • #3044427

      Reply To: ‘Find’ on both form and subform

      by jepott ·

      In reply to ‘Find’ on both form and subform

      It’s been a while since I did work in Access, but in short I believe this is what you will need to do. You will need to write some VBA for the search function to first search one form and then the next – you would probably want to search the ‘current’ form (the form with the focus) and then switch the focus to the next form and search it. Off the top of my head, this seems like it could end up being a lengthy sub-routine running a DO WHILE loop or something similar.

      I hope that gets you pointed in the right direction.

      JEPott

    • #3045720

      Reply To: ‘Find’ on both form and subform

      by Anonymous ·

      In reply to ‘Find’ on both form and subform

      I suggest you create a parameter query joining the two recordsources using a one-to-many join, where the parameter is the control value on the form/subform you wish to search on, and then run the query in VBA to return the record/s required…

Viewing 2 reply threads