Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007

    Unanswered: How to create a form with user prompts for query

    I am new to making forms in access. I want to create a form, where the user can enter query parameters such as date, store, sku, or leave them blank for a broader search. I have only 1 table that contains all the data, but I would like to have a form where the user can query the data. How do I go about creating such a form? Do I need to have a query that the form uses? How do I get started? Thanks.

  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    Basically you would have all of the controls (textboxes, checkboxes, etc.) that you want the user to enter parameters in. THen you would have a button to show the results. And maybe one to close the form.

    When you press the "show results" button you would create a string that had the SQL in it that you would want to run. The string would look at each of the values in the textboxes, checkboxes, etc. and would create the SQL. Then you can display the data in a subform or as a separate query.

    Another approach is to add the 'parameters' in the query. If you put [Enter Date] in the criteria for a date field, the user will be prompted for some data with the title Enter Date. The user will be presented with the Input Box which doesn't allow you to make sure the input is valid (formatted like a date mm/dd/yy instead of some random string or number).

Posting Permissions

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