Two Forms and one Query.

  • Thread starter turks67 via AccessMonster.com
  • Start date
T

turks67 via AccessMonster.com

I have a query with a field call month. In this field there are different
months of the year.
I'm trying to pull serveral reports using more than on form. Is it possible
to used one query
like this:

Forms!frmform1!combo1 or Forms!frmform2!combo1

What is the correct way for this to work?
 
K

KARL DEWEY

Try this --
(Forms!frmform1!combo1 OR Forms!frmform1!combo1 Is Null) OR
(Forms!frmform2!combo1 OR Forms!frmform2!combo1 Is Null)
 
J

John Spencer

That will only work if both forms are open. And if both forms are open you
are likely to get unexpected results.

You can use a Custom VBA function to check which form is open and then return
the value of the combobox from that form.

OR you can set a global variable from the forms and retrieve that value using
a custom VBA function

Or ...


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
K

KARL DEWEY

Other was not tested, this was tested a little --
Like IIf([Forms]![frmform1]![combo1] Is Null And [Forms]![frmform2]![combo1]
Is Null,"*",IIf([Forms]![frmform1]![combo1] Is
Null,[Forms]![frmform2]![combo1],[Forms]![frmform1]![combo1]))
 

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