Combo Box Filtering between Forms

A

andrew_ww

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.
 
J

Jeff Boyce

Andrew

This seems like you're making more work for yourself (and for Access) than
you need to.

What about the idea of using an (unbound) combobox in the header of a form,
then "loading" THAT form with the record selected?

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top