Results 1 to 13 of 13
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Qry Form Change (2002)

    I have a form that has Name, Address etc I have a table of zip codes. I am trying to have a qry lookup zip codes (which I have made) place the requested information on a form, rather than a datasheet view. Is this possible?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    Would a combo box with the query as row source do what you want? I don't understand your description.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    Normally when a qry is run, it shows the results in a datasheet form. I would like to have the result shown in a form view, that could be used as a subform.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    Create a form based on the query, and use that form as a subform.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    That doesn't seem to work. I still get the results in a datasheet format, in another window. Any other ideas?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    Have you placed the new form on the existing form as a subform?

  7. #7
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    OK I've Gotten it to work.
    Now when I open the main form, the qry runs, before the form opens. How do I stop that from happening?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    You shouldn't run or open a query at all. Just use the form and subform.

  9. #9
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    It seems that I have no choice. When I open the main form using the swwitchboard, the qry runs. After I enter the request, the form's appear, but then I have no way of requesting another qry. I hope this isn't too confusing!

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    I don't understand. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  11. #11
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    OK here it is.
    1. When you open the DB, open the switchboard, choose "Data Entry Form", You will be asked to enter a city, then a state.(this is no good)
    hit enter both times. The form will open with the results shown in the subform. (this is good), Then click on the QRY button and hit enter both times. Instead of placing the results of the qry in the subform, another datasheet opens. (This is no good).
    I would like to have the Data entry form open, then if needed, use the qry button and have the results appear in the subform.

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Qry Form Change (2002)

    Your command button is programmed to open a query, so it opens a query. In the attached version, I have done the following:
    - I have added an unbound text box and combo box to the form to replace the parameter prompts.
    - I have set the record source of the subform to the ZIP+CODES table.
    - I have changed the code behind the command button so that it filters the subform instead of opening a query.

  13. #13
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Monroeville, Pennsylvania, USA
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Qry Form Change (2002)

    Thanks Much. It Works Just like I planned <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23> Maybe sometime I'll learn enough VB to be dangerous. Thanks again..

Posting Permissions

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