Opening the same form with different queries

  • Thread starter Thread starter Jerry Crosby
  • Start date Start date
J

Jerry Crosby

I have a form with 3 command buttons, labeled "This Month", "Last Month" and
"This Year". It's the "pre-form" to another form that has a date field in
it.

The onclick property for each button opens the very same form, but I'd like
the query for the form to catch the dates for this month, or last month, or
this year respectively.

I have the queries developed and working, but it seems I should be able to
use one form, rather than use 3 basically identical forms that vary only in
the underlying query.

How?
 
Jerry,
You can programaticcally change the RecordSource for a form at any
time...
Me.RecordSource = 'Your SQL statement here...

But it might be easier to just filter the records according to a date
range by using the Filter and Filteron functions.
 

Ask a Question

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.

Ask a Question

Back
Top