PLEASE HELP. Reposting.

S

Sue

I want to develop a form that has a command button which will open a
parameter query. The parameter is a date field. There are 3 dates:
"ScreeningDate", "ICFDate", and "D1Tx", each of which is drawn from a table.
I need to be able to open the query if any of those 3 fields are equal to or
greater than a given date.

I'm thinking my first step is to add a new field to my parameter query which
says something like ". Include any records in which "ScreeningDate",
"ICFDate", or "D1Tx" is > or = such-and-so a date. How do I do that, and then
how do I make the command button do what I'm asking it for?

I can't post to the discussion board any more, by the way, from my new
laptop or from my work machine. . I can't respond to posts or ask a new
question, nor can I even sign out (to try logging back in). I have allowed
pop-ups for the site on both machine. The only thing I can guess is this:
I've recently gotten a new computer. The old one is still in daily use. Since
getting the new machine, each time I log on I get a popup box indicating that
I can't sign in to net password as I'm signed in elsewhere. Please help with
this if at all possible.

You may respond to me directly at [email protected] or, alternatively, I'll
check the old machine when I get back home tonight.

MANY THANKS FOR ALL YOUR HELP!!!
 
M

Mikal via AccessMonster.com

Sue said:
I want to develop a form that has a command button which will open a
parameter query. The parameter is a date field. There are 3 dates:
"ScreeningDate", "ICFDate", and "D1Tx", each of which is drawn from a table.
I need to be able to open the query if any of those 3 fields are equal to or
greater than a given date.
Here's the SQL for a parameter query that ought to work:

PARAMETERS [MyDate] DateTime;
SELECT tblMyDates.*
FROM tblMyDates
WHERE (((tblMyDates.ScreeningDate)>=[MyDate])) OR (((tblMyDates.ICFDate)>=
[MyDate])) OR (((tblMyDates.D1Tx)>=[MyDate]));

I'm thinking my first step is to add a new field to my parameter query which
says something like ". Include any records in which "ScreeningDate",
"ICFDate", or "D1Tx" is > or = such-and-so a date. How do I do that, and then
how do I make the command button do what I'm asking it for?
Just use the wizard to put in a button that opens your query. Since you are
using a button on a form that will be open already, you can put a text box on
the form and pass the date parameter to the query like this:


SELECT tblMyDates.*
FROM tblMyDates
WHERE (((tblMyDates.ScreeningDate)>=Me.tboMyDate)) OR (((tblMyDates.ICFDate)
=Me.tboMyDate)) OR (((tblMyDates.D1Tx)>=Me.tboMyDate));

This assumes that the name of your table is tblMyDates and that the name of
the text box on your form is tboMyDate.

The advantage to the first way is that the query can be run whether the form
is open or not and it will work. The second way is prettier but it won't
work if the form is closed and you try to run the query from someplace else.

Caveat: I tried out the parameter query. I did not try out the form based
version so you might have to tweak it or you might even find out I don't know
what I'm talking about there. Wouldn't be the first time.

BTW. Putting your email address in these forums is a really good way to
collect a lot of spam. If you have to post your email address do something
to obfuscate it so that a human has to read the thing to make sense of it.

HTH
Mike
 
M

Mikal via AccessMonster.com

Mikal said:
SELECT tblMyDates.*
FROM tblMyDates
WHERE (((tblMyDates.ScreeningDate)>=Me.tboMyDate)) OR (((tblMyDates.ICFDate)

On Second thought. Instead of Me.tboMyDate, Make that Forms.myform.tboMyDate.


Told you it wouldn't be the first time. Might not even be the last time in
this thread.
 
Top