P
prothery
I want to run a parameter query with four parameters - this is tedious for
users. Is there a way to enter them on a nice tidy form ?
users. Is there a way to enter them on a nice tidy form ?
Douglas J. Steele said:You can replace the parameters in the query with references to controls on a
form using Forms![NameOfForm]![NameOfControl]
Note that the controls can be combo boxes rather than text boxes if you want
to limit what's selected.
The form must be open when the query runs, though: Access will not open the
form for you.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
prothery said:I want to run a parameter query with four parameters - this is tedious for
users. Is there a way to enter them on a nice tidy form ?
So strWhere is And And [listbox selection].
Hi, I tried your examples in my own database and the null propagation isn't
working. So strWhere is And And [listbox selection]. If someone picks from
only the 3rd listbox, the first 2 are set to null.
Any idea what I am doing wrong? __________________________________________
"Tom Wickerath" wrote:
Tom Wickerath said:Hello -
So strWhere is And And [listbox selection].
It *appears* as if you have one of the AND statements outside of a set of
parentheses, or you are concatenating this keyword instead of using an
addition. However, I cannot see your code, so I have no way of knowing for
sure.
I only discovered your reply by chance, and it came through as a single
message without the rest of the messages in the thread. I think the reason
for this is that you waited so long to reply, that the other messages in this
thread "aged off" of the newsgroup server. I finally found the rest of the
thread by using the web interface, and searching for "lil2009".
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
:
From: "lil2009" <[email protected]>
Newsgroups: microsoft.public.access
Sent: Wednesday, August 26, 2009 6:21 PM
Subject: RE: Multiple parameters
Hi, I tried your examples in my own database and the null propagation isn't
working. So strWhere is And And [listbox selection]. If someone picks from
only the 3rd listbox, the first 2 are set to null.
Any idea what I am doing wrong? __________________________________________
"Tom Wickerath" wrote:
By: Tom Wickerath
In: microsoft.public.access
4/5/2009 1:00 PM PST
Subject: RE: Multiple parameters
Tom Wickerath said:Hello -
So strWhere is And And [listbox selection].
It *appears* as if you have one of the AND statements outside of a set of
parentheses, or you are concatenating this keyword instead of using an
addition. However, I cannot see your code, so I have no way of knowing for
sure.
I only discovered your reply by chance, and it came through as a single
message without the rest of the messages in the thread. I think the reason
for this is that you waited so long to reply, that the other messages in this
thread "aged off" of the newsgroup server. I finally found the rest of the
thread by using the web interface, and searching for "lil2009".
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
:
From: "lil2009" <[email protected]>
Newsgroups: microsoft.public.access
Sent: Wednesday, August 26, 2009 6:21 PM
Subject: RE: Multiple parameters
Hi, I tried your examples in my own database and the null propagation isn't
working. So strWhere is And And [listbox selection]. If someone picks from
only the 3rd listbox, the first 2 are set to null.
Any idea what I am doing wrong? __________________________________________
"Tom Wickerath" wrote:
By: Tom Wickerath
In: microsoft.public.access
4/5/2009 1:00 PM PST
Subject: RE: Multiple parameters
Tom Wickerath said:At this point, I think I can provide more effective help if I have a copy of
your database to work on. If you can send me a compacted and preferably
zipped copy of your database, I will take a look at it. Remove any sensitive
data before sending.
If you are interested, send me a private e-mail message with a valid
reply-to address. My e-mail address is available at the bottom of this page:
http://www.access.qbuilt.com/html/expert_contributors.html#TomW
Scroll down past the two pictures, to the bottom of the page, where you
should see a clickable link. Please do not post your e-mail address (or mine)
to a newsgroup reply. Doing so will only attract the unwanted attention of
spammers.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
lil2009 said:Hi, I hope I haven't waited too long for this response.
Here is my code.
strWHERE = " Where " & (varONFxn + " AND ") & (varDNFxn + " AND ") &
(varIHFxn + " AND ") & (varECFxn + " AND ") & (varCryFxn + " AND ") &
(varAreaFxn + " AND ") & (varEDTFxn)
Here are the debug.print statements.
strWhere with fxn concatenation = Where [tblDS].[ON] In ('ONChoice1') AND
AND
strWHERE without trailing AND= Where [tblDS].[ON] In ('ONChoice1') AND
I am very new to this and I currently have the options in queries that are
called when a report is opened, but I can only have a few choices with that
one so I thought I would try it this way. Your examples are very useful.
Thanks for your help!
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.