469,275 Members | 1,871 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Why does "Enter your parameter value" keep coming up?

By putting forms![name of form]![name of checkbox] in the criteria area and in the criteria row putting TRUE runs a query for me off of check boxes.

However, "Enter your parameter value" boxes pop up for each check box when the form opens. Why is that and how do I avoid it?

All I want is for the end user to check the boxes and then press the button to run the query.

Thank you!
Dec 10 '10 #1
7 8645
32,172 Expert Mod 16PB
However, "Enter your parameter value" boxes pop up for each check box when the form opens. Why is that and how do I avoid it?
You say "when the form opens", but I would expect this to occur only when the query is attempted. Are you sure?

We will also need some details if we're to be any help with this. What is the SQL of your query? If the CheckBoxes really do have a problem, then how are they defined? There needs to be more information in the question.
Dec 13 '10 #2
What I'm trying to do creat a form where the end user will click on the checkboxes (it could be more than one checkbox) and have the query run based on those choices. The query's table will pop up with the name of the company. I also need to generate a report based on the results, too.

Here is the SQL that I have in my query:


Expand|Select|Wrap|Line Numbers
  1. SELECT Contacts.Company, Contacts.FoF, Contacts.[NHF], Contacts.[SM], Contacts.[FC], Contacts.[CO]
  2. FROM Contacts
  3. WHERE (((Contacts.FoF)=[forms]![Portfolio Status subform]![FoF]) AND ((Contacts.[NHF])=[forms]![PStatus subform]![NHF]) AND ((Contacts.[SM])=[forms]![PStatus subform]![SM]) AND ((Contacts.[FC])=[forms]![PStatus subform]![FC]) AND ((Contacts.[CO])=[forms]![PStatus subform]![CO]))

Expand|Select|Wrap|Line Numbers
  1. (((Contacts.[CO])=[forms]![PStatus subform]![CO]) AND (([forms]![PStatus subform]![FoF]) Is Null) AND (([forms]![PStatus subform]![NHF]) Is Null) AND (([forms]![PStatus subform]![SM]) Is Null) AND (([forms]![PStatus subform]![FC]) Is Null));
Thank you very much!
Dec 13 '10 #3
32,172 Expert Mod 16PB
I'm still confused as you didn't answer my first question. Thank you for the SQL, but that is only data from which to work. Without the question I have nowhere to go.

To save a valueless post, I've redone your SQL so that it can be read more easily, though what you're saying with the OR: bit at the end I have no clue about.
Expand|Select|Wrap|Line Numbers
  1. SELECT [Company]
  2.      , [FoF]
  3.      , [NHF]
  4.      , [SM]
  5.      , [FC]
  6.      , [CO]
  7. FROM   [Contacts]
  8. WHERE (([FoF] = [forms]![Portfolio Status subform]![FoF])
  9.   AND  ([NHF] = [forms]![PStatus subform]![NHF]) 
  10.   AND  ([SM] = [forms]![PStatus subform]![SM])
  11.   AND  ([FC] = [forms]![PStatus subform]![FC])
  12.   AND  ([CO] = [forms]![PStatus subform]![CO]))
Expand|Select|Wrap|Line Numbers
  1. WHERE (([CO] = [forms]![PStatus subform]![CO])
  2.   AND  ([forms]![PStatus subform]![FoF] Is Null)
  3.   AND  ([forms]![PStatus subform]![NHF] Is Null)
  4.   AND  ([forms]![PStatus subform]![SM] Is Null)
  5.   AND  ([forms]![PStatus subform]![FC] Is Null));
Are we still talking about a form problem (as you implied when you said it occurred as the form was opened)? Or should we be looking more closely at the query itself (as the error message indicated)?
Dec 13 '10 #4
It happens when I try to open the form up. I can only open the form in design view. If I try to open it up, like a user would, those parameter boxes come up.

Ah I see what you mean on how to post SQL, I will remember that next time. I appreciate the revision.

I am trying to create a form that the user can check the boxes (choices) to run a query. I have the form with the checkboxes. I have the query (SQL). But I don't know why the Enter Parameters keeps popping up.

Do you have a better suggestion for a checkbox based query?
Dec 13 '10 #5
32,172 Expert Mod 16PB
That sounds like a problem whose details we don't have then Faith. If this is happening when the form is opened then something is possibly set up in the form that we need to know about if we're to progress. It may be a good idea to post a copy of the database for me to have a look at. I'll dig up some general instructions for you on how best to go about that if you're interested.

When attaching your work please follow the following steps first :
  1. Remove anything not relevant to the problem. This is not necessary in all circumstances but some databases can be very bulky and some things do not effect the actual problem at all.
  2. Likewise, not entirely necessary in all cases, but consider saving your database in a version not later than 2003 as many of our experts don't use Access 2007. Largely they don't want to, but some also don't have access to it. Personally I will wait until I'm forced to before using it.
  3. If the process depends on any linked tables then make local copies in your database to replace the linked tables.
  4. If the database includes any code, ensure that all modules are set to Option Explicit (See Require Variable Declaration).
  5. If you've done anything in steps 1 to 4 then make sure that the problem you're experiencing is still evident in the updated version.
  6. Compile the database (From the Visual Basic Editor select Debug / Compile {Project Name}).
  7. Compact the database (Tools / Database Utilities / Compact and Repair Database...).
  8. Compress the database into a ZIP file.
  9. When posting, scroll down the page and select Manage Attachments (Pressing on that leads you to a page where you can add or remove your attachments. It also lists the maximum file sizes for each of the allowed file types.) and add this new ZIP file.
It's also a good idea to include some instructions that enable us to find the issue you'd like help with. Maybe some instructions of what to select, click on, enter etc that ensures we'll see what you see and have the same problems.
Dec 14 '10 #6
Nothing was working. So I started from scratch (before seeing your post).

Query name is "PortStat"

My query has the company name plus the fields/controls
(NH, SM, FC, CO).

I then opened a blank form (design view), bound it to the PerfStat query. I then selected the checkbox in the menu area then dragged over the controls. Easy enough.

This time the form opens just fine. The checkboxes take the check mark, but as soon as I run the query it brings up all records showing those check boxes whether they are checked or not.

So I'm sure I need to put something in the criteria of the query but not sure how to. It could be one or more of the boxes checked. Something to tell it to only pull the records with the boxes that were checked.

Does this come across as clear? Hard to explain it (I'm still very far from an expert).
Dec 14 '10 #7
32,172 Expert Mod 16PB
Why would your form, that is there to control which records to show in a query, be bound?

Think about this clearly and deeply. If you get what's going on here you will have an important understanding.
Dec 15 '10 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.