How to search an Access Form using one data field as the search field.

Posted on 2007-07-20
Last Modified: 2013-11-28
Is there a way to search all text fields at once on an Access Form using one field to enter the search data, and then displaying the results in a separate form?
Question by:UFCWIT
    LVL 13

    Expert Comment

    If the date is only in one field why search entire form

    Why not just search date field and open form to matches.

    DoCmd.OpenForm "form2", , , "[datefield]=" & "'" & Me![datefield] & "'"
    LVL 119

    Accepted Solution

    yes, you open the other form with a where condition

    if field is text
    docmd.openform "otherForm",,,"[fieldName]='" & me.fieldname &"'"  

    if field is number
    docmd.openform "otherForm",,,"[fieldName]=" & me.fieldname

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now