From: AccessKay on
Hi,
How complicated is it to create a form so the user can input things like
date range, dept, group, etc. and then have another form to pop up with the
data based on the inputs? What do I need to know to make this happen? I'll
probably need to read more about forms and subforms but what is the general
process?
Thanks!

From: Tom van Stiphout on
On Fri, 26 Mar 2010 06:38:01 -0700, AccessKay
<AccessKay(a)discussions.microsoft.com> wrote:

You can certainly build a form to do this, but it is already built-in.
Check "Query by Form" menu option. You would run it on your main form
and it allows you to put in a complex filter over several fields.

If you have to write your own form: you could create a new form with
some textboxes and dropdowns as you indicated. Then have a button
"Open Main Form". In that button_click event concatenate a string
variable that will be the where-clause for the form. Something like:
strWhere = "myDateField between #" & Me.txtStartDate & "# and #" &
Me.txtEndDate & "#"
etc.
Then on the next line you open the form using DoCmd.OpenForm, and you
use this string in the WhereCondition argument.

-Tom.
Microsoft Access MVP


>Hi,
>How complicated is it to create a form so the user can input things like
>date range, dept, group, etc. and then have another form to pop up with the
>data based on the inputs? What do I need to know to make this happen? I´┐Żll
>probably need to read more about forms and subforms but what is the general
>process?
>Thanks!
From: AccessKay on
Fun! That's really cool that Access has a built-in capability for this. I'm
going to play around with this and also try to learn how to write my own
form. I'd like to learn both ways. Thanks so much for giving me some good
direction.

"Tom van Stiphout" wrote:

> On Fri, 26 Mar 2010 06:38:01 -0700, AccessKay
> <AccessKay(a)discussions.microsoft.com> wrote:
>
> You can certainly build a form to do this, but it is already built-in.
> Check "Query by Form" menu option. You would run it on your main form
> and it allows you to put in a complex filter over several fields.
>
> If you have to write your own form: you could create a new form with
> some textboxes and dropdowns as you indicated. Then have a button
> "Open Main Form". In that button_click event concatenate a string
> variable that will be the where-clause for the form. Something like:
> strWhere = "myDateField between #" & Me.txtStartDate & "# and #" &
> Me.txtEndDate & "#"
> etc.
> Then on the next line you open the form using DoCmd.OpenForm, and you
> use this string in the WhereCondition argument.
>
> -Tom.
> Microsoft Access MVP
>
>
> >Hi,
> >How complicated is it to create a form so the user can input things like
> >date range, dept, group, etc. and then have another form to pop up with the
> >data based on the inputs? What do I need to know to make this happen? I'll
> >probably need to read more about forms and subforms but what is the general
> >process?
> >Thanks!
> .
>