Query used to produce report based on combobox selection

V

van

Hi

I have developed an application which when you choose an option from a
combobox, it sends off a query to produce a form displaying only the
required results depending on previous combobox selection. This form is an
area where the data may be amended b4 producing a report. I then produce a
preview of the report via a command button, but it is retrieving ALL records
in the table, and for the report I only require those which match the
combobox selection.

I have tried the following condtions in a sql statement and both prompt me
to enter a value for .....combo9:

WHERE [tbl_TEST].[TESTName]=me!Forms.frmMainmenu.combo9;
WHERE [tbl_TEST].[TESTName]=me![Forms]![frmMainmenu]![combo9];

How can I work around this? Any suggestions?
 
M

Michel Walsh

Hi,


remove me! in the second case.


The "mailing address" anchor point is the FORMS collection maintained by
Access, not me , the reference of the actual VBA object. You ask to
find frmMainMenu starting to look from the FORMS collection, *not* starting
by looking at me, then at its [forms] property, etc.

Hoping it may help,
Vanderghast, Access MVP
 

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