Results 1 to 11 of 11

Thread: Query By form

  1. #1
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59

    Question Unanswered: Query By form

    Hi
    Could some please tell me how to create a query that is based on user input from a form, I have tried but im having no luck.

    What i want the form to do is the following:
    User opens the form up and enters a date in a text box.

    The form then shows the user all records for the entered date.

    Can this be done easily as im a new user.

    Thanks
    Icerat

  2. #2
    Join Date
    Jun 2004
    Posts
    55
    In your query put, under the dates cell use the criteria:

    [Forms]![Nameofform]![Nameoftextbox]

    In your form use the following event coding, for whatever you want to open the query:

    DoCmd.OpenQuery "NameofQuery"

  3. #3
    Join Date
    Jul 2004
    Location
    Kent
    Posts
    59
    Thanks got that part working, it puts the results of the query in a new window, anyway to get it on the same form

    Icerat

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Create a form based on yor query. Look up ApplyFilter in help, that should do what you need.

  5. #5
    Join Date
    Jun 2004
    Posts
    55
    Yeah make a subform based on that query. Take out the DoCmd thing and replace it with

    Me.Subformname.Form.RecordSource = "NameOfQuery"

  6. #6
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Is there an easy way to create a form that has fields a-g on it, but the user can say I want to see a,b, and e fields?

  7. #7
    Join Date
    Jun 2004
    Posts
    55
    When you say fields you mean controls (e.g. Textboxes) or actual fields like in a table?

  8. #8
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Actual fields...ex: say we have employees and each has 4 phone numbers. Can the user say I want to say I want number 2&4?

  9. #9
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    PS I cant figure out how to do the stuff that this thread started on
    Last edited by rguy84; 07-02-04 at 11:44.

  10. #10
    Join Date
    Jun 2004
    Posts
    55
    Um Yeah I'm not too sure about that myself. I'd start a new thread and see if anyone knows.

  11. #11
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Quote Originally Posted by dwil2g1
    Um Yeah I'm not too sure about that myself. I'd start a new thread and see if anyone knows.
    Ok thanks, I will try that

Posting Permissions

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