Access form or code to ask for different fields to change in query

Posted on 2012-08-28
Last Modified: 2012-08-29
I would like to create an Access form or code that would ask the following.

What type of fields do you want data for:

1) Resp_id
2) Ppty_ID
3) Multiple ppty_ids

Based on the above selection, then if a person selects #3 it would say:

Please enter the multiple ppty_ids you want data for:

Then the query would execute with the above criteria, and would output to an Excel file, SvyData.xlsx.

Query is in attached Access file.

Could someone please help with how to do this?

Question by:Patty01Access
    LVL 30

    Accepted Solution

    Try this sample database.
    Run Form1
    Select Field
    Click Work! Button
    Enter criteria: single 1  or multiple 1, 2

    Check file D:\myOutput.xls

    Author Closing Comment

    BEAUTIFUL!!!  Thanks much Hnasr!!

    I never knew there was an "In..." criteria you could use in a query.

    Thanks again,
    LVL 30

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    758 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

    13 Experts available now in Live!

    Get 1:1 Help Now