Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50

    Unanswered: Passing Parameters from Combos

    I know somebody out there has the answer to this one . . .

    Example: A form called "INTERACTIVE SEARCH" uses a table called "SWITCH INFORMATION". If the following is in the "after update" event of Combo100 on the form:

    Private Sub Combo100_AfterUpdate()
    [Forms]![INTERACTIVE SEARCH].Filter = "[Tables]![SWITCH INFORMATION]![DIVISION]=[Combo100]"
    [Forms]![INTERACTIVE SEARCH].FilterOn = "True"
    End Sub

    And "EASTERN" is selected in Combo100, why is a dialog box (pic below) still coming up for parameter entry? Notice that the selection in Combo100 now shows up as a title in the dialog box. I would like the records to filter automatically on Combo100 events. How can I pass this parameter?

    Thanks - Stace.
    Attached Thumbnails Attached Thumbnails DROP DOWN SEARCH 7.jpg  
    Thanks in advance or hope this helps.

  2. #2
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Let me see if I understand you properly...

    1 You have a form that you want to allow your users to use to search?
    2 It is called INTERACTIVE SEARCH and has a combo box named Combo100?
    3 I am not sure why you are using filters (I have never quite understood the concept of them).
    4 How are your queries setup? It might be advantageous for you to use VBA to set your queries instead of trying to use the Access query builder. I found that much easier. I have about 10 queries for one search I had. I built a more advanced search and used VBA not even a single access query was taking up database room. So I think this might be a case for some VBA programming.
    5 How many available selections are there in the combo box?
    6 Do the rest of them work?

    I think if I get an answer to these questions I may be able to assist you further.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  3. #3
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    1 You have a form that you want to allow your users to use to search?

    Close. I have a form that I want users to use to filter the records of the underlying table. IOW, get just the records they want to look at based on a selection in the Combo.

    2 It is called INTERACTIVE SEARCH and has a combo box named Combo100?

    Correct.

    3 I am not sure why you are using filters (I have never quite understood the concept of them).

    As stated in #1, to retrieve only specific records.

    4 How are your queries setup? It might be advantageous for you to use VBA to set your queries instead of trying to use the Access query builder. I found that much easier. I have about 10 queries for one search I had. I built a more advanced search and used VBA not even a single access query was taking up database room. So I think this might be a case for some VBA programming.

    Not using queries. Each record of this table is associated to another table with a "one to many" relationship. The associated records from table #2 show up in a subform on the form. I couldn't get queries to function the way I wanted, but the tables worked so I stuck with them. I'm considering going back and attempting building on queries again, since I know how to handle the combo in that situation. Still, I'd like to know why I couldn't pass the parameter for future reference. It just doesn't make sense.

    5 How many available selections are there in the combo box?

    4........EASTERN, WESTERN, NORTHERN, SOUTHERN.

    6 Do the rest of them work?

    No. Each selection behaves in the same manner.


    Thanks again.

    Stace.
    Thanks in advance or hope this helps.

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Stace,

    Take a look at the sample db I have attached here which is a form used to enter criteria to seach for. See if that gets you close to what you want. If not I will try something else to assist you.

    have a nice one,
    Bud
    NOTE:Is is always best to make a copy of the database and Zip and Attach it here so that others can get a better look/understanding of your situation. Replace all private data and add enough to create your situation.
    Attached Files Attached Files

  5. #5
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50

    Print Preview a Form's Records?

    Thanks for the reply, Bud. Sorry I haven't replied sooner. I've reworked everything using querys instead of direct tables, and have the "filter by combo" scheme working flawlessly. Which brings me to my next trick question . . .

    If I have an open form with an underlying query, can I set up a control button to print preview the already open query, or will I have to open the query again?
    Thanks in advance or hope this helps.

  6. #6
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Is the query really open or just being used by the form?

    I dont know if you can print preview a query that is already in use. I am pretty sure it is possible, because I know when I have a form open that is linked to a table through a query I cant open the table to edit, but it will allow me to open in read only.

    Let me know,
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  7. #7
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    Just looking at your origional question I think this line

    [Forms]![INTERACTIVE SEARCH].Filter = "[Tables]![SWITCH INFORMATION]![DIVISION]=[Combo100]"

    should be

    [Forms]![INTERACTIVE SEARCH].Filter = "[Tables]![SWITCH INFORMATION]![DIVISION]= '" & Combo100 & "'"

    if [DIVISION] is a text field

    I to am sure you can open a query irrespective of wether it is already in use, but, as with everything, just try it and see what happens!


    MTB

  8. #8
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Smile

    Quote Originally Posted by reoterq
    If I have an open form with an underlying query, can I set up a control button to print preview the already open query, or will I have to open the query again?
    Hi reoterq,

    If you have an underlying query with a Form or Report based on it, you can create a command button to open either of those, but not the Query itself. Is that what you're asking? Whatever your query is, create either a Form or Report to display the results. Then simply create a CommandButton (with the wizard) to open that Form or Report.

    Bud

  9. #9
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Mike - I think you're probably right now that I look at it, but I've pretty much rewritten the whole project. Got it working, but that might have saved me a lot of work.

    Bud & JS - I'm using a form to filter a query based on combo selections. What I want to do is print preview the filtered records only. I accomplished that by running a macro using requery, then openreport with a conditional based filter. What I want to know is does anyone know how to run a report on the form filtered query directly (and avoid all the mumbo-jumbo). Thanks again.

    Stace.
    Thanks in advance or hope this helps.

  10. #10
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Stace,

    I'm not sure if you checked it out or not OR whether I'm totally missing something here. The sample db I posted on here would Filter your choices on the form with a ComboBox, then when you click the Open Report button, the report would open containing the data you selected in your ComboBox. Also, I can set the ComboBox so that as soon as you make your selection and let go of the mouse from it, your report will simply open automatically. Maybe I am off in another world. Just trying to get to your solution. Too bad you can't post it here to get it fixed for you. Seems words alone are not getting to the solution. But in case you didn't check out my sample db.

    have a nice day, I'm gone for the day
    BUD

Posting Permissions

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