Query by Form

Query by Form

am 25.01.2008 23:40:32 von Menelomie

I have spent more time than I am willing to admit trying to figure
this out...

I'm trying to use a form to manage the criteria in a query. This one
query feeds to numerous other append queries as part of a monthly
maintenance process. The query that I'm updating basically needs to
be changed each month to reflect the current month. I'm not looking
for the query to show me the results, I just want to use a form to
enter the criteria rather than open the query and change the criteriat
manually. If I use a parameter query, it asks me for the information
as soon as every append query loads.

HELP!

Re: Query by Form

am 26.01.2008 03:35:29 von Allen Browne

If you just want the query to filter out all dates from previous months, you
could use this in the Criteria row under your date field in query design:
< (Date() - Day(Date()) + 1)

If you want something more, see:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Menelomie" wrote in message
news:16358510-59f1-4fae-82bc-dafe8a0074fd@m34g2000hsb.google groups.com...
>I have spent more time than I am willing to admit trying to figure
> this out...
>
> I'm trying to use a form to manage the criteria in a query. This one
> query feeds to numerous other append queries as part of a monthly
> maintenance process. The query that I'm updating basically needs to
> be changed each month to reflect the current month. I'm not looking
> for the query to show me the results, I just want to use a form to
> enter the criteria rather than open the query and change the criteriat
> manually. If I use a parameter query, it asks me for the information
> as soon as every append query loads.
>
> HELP!

Re: Query by Form

am 26.01.2008 12:53:31 von anthony

Is it as simple as putting [Forms]![YourForm]![FormFieldName] in the
criteria section of the query or am I missing something?

Re: Query by Form

am 27.01.2008 23:40:02 von Menelomie

On Jan 25, 8:35=A0pm, "Allen Browne" wrote:
> If you just want the query to filter out all dates from previous months, y=
ou
> could use this in the Criteria row under your date field in query design:
> =A0 =A0 < (Date() - Day(Date()) + 1)
>
> If you want something more, see:
> =A0 =A0 Search form - Handle many optional criteria
> at:
> =A0 =A0http://allenbrowne.com/ser-62.html
>
> --
> Allen Browne - Microsoft MVP. =A0Perth, Western Australia
> Tips for Access users -http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Menelomie" wrote in message
>
> news:16358510-59f1-4fae-82bc-dafe8a0074fd@m34g2000hsb.google groups.com...
>
>
>
> >I have spent more time than I am willing to admit trying to figure
> > this out...
>
> > I'm trying to use a form to manage the criteria in a query. =A0This one
> > query feeds to numerous other append queries as part of a monthly
> > maintenance process. =A0The query that I'm updating basically needs to
> > be changed each month to reflect the current month. =A0I'm not looking
> > for the query to show me the results, I just want to use a form to
> > enter the criteria rather than open the query and change the criteriat
> > manually. =A0If I use a parameter query, it asks me for the information
> > as soon as every append query loads.
>
> > HELP!- Hide quoted text -
>
> - Show quoted text -

So will this always just return the current month - is that what you
are saying? My month field is fomated in double digits (01, 02, etc.)
I will give that a shot.

Re: Query by Form

am 27.01.2008 23:43:17 von Menelomie

On Jan 26, 5:53=A0am, anthony wrote:
> Is it as simple as putting [Forms]![YourForm]![FormFieldName] in the
> criteria section of the query or am I missing something?

I did try [Forms]![YourForm]![FormFieldName]

but whenever I used the drop down on that form, selected my criteria -
Other queries that I was running using that criteria weren't working.
It seemed like it would just show me results where as I actually
wanted to hardcode that criteria in the appropriate query. Does that
make sense?

All I am doing is going into this query each month an changing the
current month from 12 to 01 or 02 or whatever. I want to get this
database over to a group in another state who have never used access
before and I am trying to simplify how they will update these month
codes w/out having to go into any tables, queries, etc.

Re: Query by Form

am 28.01.2008 03:19:38 von Allen Browne

"Menelomie" wrote in message
news:c659914d-25ac-4d5c-9ecc-bf818fd39118@e4g2000hsg.googleg roups.com...
>> If you just want the query to filter out all dates from previous months,
>> you
>> could use this in the Criteria row under your date field in query design:
>> < (Date() - Day(Date()) + 1)
>
> So will this always just return the current month - is that what you
> are saying? My month field is fomated in double digits (01, 02, etc.)
> I will give that a shot.

It doesn't matter how your field is formatted: as long as it is a date/time
field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

Re: Query by Form

am 29.01.2008 18:31:31 von anthony

Sorry, should really have been [Forms]![YourForm]![FormControlName]

I'm having difficulty understanding why this isn't working. If all the
relevant fields are formatted as the same date format, then asking the
query to look at a form for its criteria shouldn't present any
problems. You mention that other queries stop working. Is this because
they are looking at the same control and expecting a different value
to the one you are using for your main query? If so, create a new
control specially for this purpose