i keep getting aa prompt box asking me to enter a parameter value (1 Viewer)

MIkeD666

Registered User.
Local time
Today, 09:23
Joined
Jan 12, 2019
Messages
59
The problem I have is this when i test a query in the datasheet preview they work no problem. But as soon as i put the query in to a form or a report. I get a prompt box asking me to enter a parameter value. If I click ok without entering any thing. It go to the report or from and work fine.

Example i have simple query that is just a stock list. Just list a few fields rather then all the full list of field of the table. No input needed, other than clicking on the preview report. WHAT am i missing or doing wrong.
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:23
Joined
Sep 21, 2011
Messages
14,224
Wouldn't care to say what it is asking for and show the query code in code tags would you? :(
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:23
Joined
May 7, 2009
Messages
19,231
do you really have a parameter on your query? is it QBF?
 

MIkeD666

Registered User.
Local time
Today, 09:23
Joined
Jan 12, 2019
Messages
59
Wouldn't care to say what it is asking for and show the query code in code tags would you? :(


HI sorry am still learn, I forgot to add the code.. it's very simple
SELECT TblStock.StkName, TblStock.STkBrand, TblStock.Stkquantity, TblStock.stockID
FROM TblStock;
 

mike60smart

Registered User.
Local time
Today, 17:23
Joined
Aug 6, 2017
Messages
1,908
Hi Mike

You would not use the query as the Record Source for your Form

You should create a Form based on tblStock
 

plog

Banishment Pending
Local time
Today, 11:23
Joined
May 11, 2011
Messages
11,638
First, that query has no point--its doing nothing---just use the table itself instead of the query.

Second, what does the prompt say? Most likely you've misspelled a field name. You've prefixed every field with 'Stk' except stockID--should it be StkID?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:23
Joined
Feb 19, 2002
Messages
43,213
As long as your BE is now and will forever remain Jet or ACE, then binding a form to a table or a query with no criteria won't present a problem. If you EVER want to move your BE to a RDBMS such as SQL Server, you will find that if you don't redo your forms, the app will be much slower with SQL Server than it was with Jet/ACE.

Best practice is to bind forms to queries that include criteria that severely limits the number of rows returned. You can add combos or search fields in the form header and in the query reference the search fields. The for will initially open to no records. Then you can add the selection criteria and then press the requery button to bring up the data you want.
 

MIkeD666

Registered User.
Local time
Today, 09:23
Joined
Jan 12, 2019
Messages
59
Thank for the information. yes the query has no real task other than to display the table on a form in a standard display ,making it easer for the user( who is a none it person) to view the table. my point was the is no reason I should be getting a prompt box, it's such a simple query. But I will check the point made above by Plog. Thank you all for your help...
 

MIkeD666

Registered User.
Local time
Today, 09:23
Joined
Jan 12, 2019
Messages
59
What what can I say Good night's sleep and back to work. on running a few test runs the problem seems to have fixed it self. the only change I have done was last thing last night ( before the pub) was to tide up the data, I had a few records that were blank, which I delete. which in normal working conditions should never appear. But just to be safe i'v added a error trap to stop it happening .
 

Users who are viewing this thread

Top Bottom