Ask Experts Questions for FREE Help !
Ask
    chaserracer83's Avatar
    chaserracer83 Posts: 16, Reputation: 1
    New Member
     
    #1

    Jul 10, 2010, 07:06 AM
    Microsoft access, parameter query based on form requires all controls to be used?
    Hi,

    I am trying to run a parameter query from a form in Microsoft access 2010. I am using 7 different combo boxes. The combo box lists are populated from different queries. I was wanting to have the query take the values from the combo box only if the user selected a value form the box. I have the query set up from each combo box from the form (example [Forms]![frmProductSearch]![ProductCategoryCombo]). The query works if all the combo boxes are used and there happens to be a record with those variables but if a combo box is not used it doesn't return anything. I have tried everything I can think of to get this to work but can't. My default value in the combo box is blank. Any suggestions?

    Thank you for your time,
    Chase
    Scleros's Avatar
    Scleros Posts: 2,165, Reputation: 262
    Hardware Expert
     
    #2

    Jul 10, 2010, 09:29 AM
    Quote Originally Posted by chaserracer83 View Post
    The query works if all the combo boxes are used and there happens to be a record with those variables but if a combo box is not used it doesn't return anything.
    Well, yeah. Something has to be queried for, otherwise what's the point of running the query? What do you expect to be returned when querying for nothing?

    Quote Originally Posted by chaserracer83 View Post
    My default value in the combo box is blank. Any suggestions?
    Set default values for all the combo boxes or else pop up a message box stating the minimum number of combo boxes that have to be populated in order to run the query.
    chaserracer83's Avatar
    chaserracer83 Posts: 16, Reputation: 1
    New Member
     
    #3

    Jul 10, 2010, 09:47 AM
    Comment on Scleros's post
    Yes... I understand how a query works. What I am saying is that of the 7 combo boxes I would like for the user to be allowed to use as few as one or as many as 7. I would like for the query to ignore a combo box that has not been selected. If the def
    Scleros's Avatar
    Scleros Posts: 2,165, Reputation: 262
    Hardware Expert
     
    #4

    Jul 10, 2010, 11:02 AM
    Create a post with your additional information instead of attempting to put it all in an agree/disagree.

    If one or all of the comboboxes can be used, you can:
    A. Parse the input from the comboboxes with some custom code and then query using only the provided parameters.
    B. Check the comboboxes for input with code and if they haven't changed pass a predetermined set of parameters to the query so that it returns a result or else pops up a message that one or more inputs are required.
    C. Set appropriate defaults in the comboboxes so that the query returns a result if the user doesn't provide input.

    A blank does not equate to "don't care"; it equates to an empty string, which means that field must be empty for the record to be returned. If you truly don't care, that parameter can be passed to the query as a wildcard (*) which could also be set as the default so that all records are returned if the user doesn't enter any input.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Parameter Query [ 2 Answers ]

Hi there, I have made a parameter query that is linked to a report, prompting the user with . The Code field contains a variety of codes. However, when the parameter value shows up it only allows the user to choose one code and therefore only one code shows up in the report. I want the user to...

Calculation controls in access [ 9 Answers ]

Need help on designing a access form with calculation controls which are evenly distributed in different rows which are transferred to a table for future use as finding total materials issued to a particular person / customer.

Using Microsoft Access [ 2 Answers ]

I am new to Microsoft Access. Please me on how to build Accounting soft with it

Microsoft Access [ 1 Answers ]

How can I build a Calendar where I can schedule several activities in a monthly basis. I want this calendar to be linked to a database (access table) with at least 8 fields (Date, Project, Name of project, Type of task/activity, Name of person in charge... ) If there is any site or links where...


View more questions Search