UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Optional Parameters in a Query    
 
   
BGAccess
post Nov 10 2007, 08:45 AM
Post #1

UtterAccess Guru
Posts: 673
From: Northwest Ohio



I have a query that uses a form for parameters. One of the parameters is "Production Line" and is a combo box. In my criteria for the query for Production Line I have [Forms]![frmParameters]![cmbProdLine]. This works how I want it to, but now I would like to make it optional. Maybe optional isn't the best description, but basically if they do not select a Production Line it will run the query with ALL Production Lines. What is the best way to do this?

Kevin
Go to the top of the page
 
+
Rainlover
post Nov 10 2007, 09:00 AM
Post #2

Utterly Banned
Posts: 6,006
From: Brisbane Qld Australia



Create a new field with this - [Forms]![frmParameters]![cmbProdLine]

On the Second line of the Criteria which is the Or enter Is Null
Go to the top of the page
 
+
BGAccess
post Nov 10 2007, 09:04 AM
Post #3

UtterAccess Guru
Posts: 673
From: Northwest Ohio



Thanks Des. I tried a couple of things that didn't work and couldn't figure it out. Glad it is an easy solution!

Thanks,
Kevin
Go to the top of the page
 
+
Rainlover
post Nov 10 2007, 09:09 AM
Post #4

Utterly Banned
Posts: 6,006
From: Brisbane Qld Australia



No Problem.

You can expand this Method to have two of more parameters but it gets a bit messy after a while. That is when you should use a filter using VBA.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 10:36 AM