Results 1 to 4 of 4
  1. #1
    andrew_ww is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2009
    Posts
    2

    Combo Box Filtering between Forms

    Hello,



    I have a combo box (populated via query). I want to be able to make a choice in this then click a button. This would have the action of opening another form which has been filtered to show only records associated with this record.


    I've tried the way I think but I keep getting requests for 'parameters'

    Here is what I currently have:


    On frmMain I have a combo box which is populated with contents of query:

    SELECT [qryUnloggedRFW].[doc_number] FROM qryUnloggedRFW ORDER BY [doc_number];

    I then have this piece of VBA code:

    Private Sub Combo151_AfterUpdate()
    DoCmd.OpenForm "frmRFWNewForm", , , "[doc_number] = " & Me.Combo151
    End Sub

    Then on the second from I have the Record Source set as:

    SELECT *
    FROM tbl_management
    WHERE ((([tbl_management].[doc_number])=[forms]![frmMain]![Combo151]));


    Neither method works. I click the combo box it just keeps asking for several parameters (strangely its asking the contents on the combo box). I click the button to open the new form it still asks for one parameters

    Any help much appreciated.

    Thanks.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well you are close;

    if the second form is sourced on a query that is paramatized to only have a record set that you want in the form - then you don't need to paramatize the form during its opening - so you can drop the 'where' info of the form opening.

    next you need to trouble shoot your query as to why it is not working. you have the parameter referenced to the combo box....when something is highlighted in the combobox you should be able to manually open that query and see the resulting record set...I will hazard the guess that your bound field in the combobox is not what you think it is - queries are never wrong. So it is getting a value from that combobox which is not what you think. In Access03 the column count begins with 0 I believe - keep that in mind...

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's an additional link that you may find useful.

  4. #4
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140

    Post Combo Box Filtering between Forms

    You can achieve this by using a simple query.
    Consider the following criteria in your second form's underlying query:
    Code:
    Like "*" & [Forms]![frmDoSearch]![Combo0] & "*"
    I.e. You select a member's first name from a combo box (Combo0) via a form called frmDoSearch. You then click a command button on your form which opens a new form with ALL records containing that first name.
    Hope this helps.

    -RC

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Filtering a Query
    By jbarrum in forum Access
    Replies: 1
    Last Post: 11-20-2009, 03:03 PM
  2. cascading combo boxes on Continuous Forms
    By Jerry8989 in forum Forms
    Replies: 0
    Last Post: 10-12-2009, 10:02 AM
  3. Report Filtering
    By HM1 in forum Reports
    Replies: 2
    Last Post: 07-06-2009, 06:06 AM
  4. Replies: 0
    Last Post: 08-17-2008, 12:19 PM
  5. Filtering using a Substring Help
    By r_walk76 in forum Forms
    Replies: 2
    Last Post: 01-11-2006, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums