Re: Need Macro to do Basic Repetitive Tasks

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thank you for your response and I'll try your suggestion. BTW, I get these
e-mails suggesting that I rate responses but when I click on the links and
look around, I can't find where to thank/rate responders. If you care to
respond or think it's important, any clues on this are appreciated.

Lung
---------------------------------------------------------------------

"tina" wrote:

you can't change a query's SQL statement with a macro, you'd have to do it
in VBA. but there's no need anyway; instead, you can set your query criteria
to refer to a control on a form, and the query will use whatever is typed in
the control. you should be able to use the same technique in the textbox
control on the report - set the ControlSource to refer to the control on the
form, as

=Forms!FormName!ControlName

and in report preview the control will display whatever is typed in the form
control.

hth


"Lung" <Lung@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7950E63A-84A5-452B-9B53-C43762BABE74@xxxxxxxxxxxxxxxx
I've been using Access to run some monthly reports, manually changing data
in
a Query and the title in a Report (which utilizes the Query) each month.
That works fine except it's a bit repetitive since I do 6 different runs
each
month. I've never used a Macro before but I created one to try to
automate
the process, and it did a few of the things I wanted it to. Unfortunately
I
feel like I'm a long ways off on what I thought should be a simple
project,
particularly the way things are automated these days. I read through many
help screens and newsgroup items but only got a little further. I'd take
a
class and learn more but I doubt I'll need to do another Macro anytime in
the
next few years. Any help you can provide would be greatly appreciated.

Is there a Macro Record feature in Access whereby you can just run through
the keystrokes and have Access enter the correct Macro protocol? If so,
how
do I get to it?

If none exists, here's what I want to do.
1) Pop open a entry screen so I can enter the appropriate month number
(e.g., 2 = February) of the Report I need to run, and the appropriate year
(e.g. 2006).
2) Open up the "Test" Query in design mode.
3) Select the criteria box of the "Client Code" field, and change the
alphabet listing so that it reads ... Like "[M-Z]*"
4) Select the criteria box of the "Month" field, and change the month
number so that it reads ... Like "02*"
5) Save the Query, Close the Query, and Open up the "Test" Report.
6) Select the text field "Text16" and change it to show the correct
alphabet and month (hopefully automatically based on my input in step 2)
so
that it reads ... "Monthly Report for February 2006 M-Z"
7) Print the report
8) Save and/or Close the Report.
9) Repeat steps 2 to 9 for the other reports.



.



Relevant Pages

  • RE: Why cant I open a report using VB?
    ... You'll also get a message box telling you the value of the txtID control - ... Run the query to see if it returns any records. ... know that the query is fine, and so is the data that the report is based on. ... intTestID = Forms!frmDrive!Text35.Value ...
    (microsoft.public.access.modulesdaovba)
  • Re: Cant return all records
    ... tends to require additional explanation. ... which produced all of the records when I ran the query. ... there was a problem with the report. ... >> Considering just the Response section, ...
    (microsoft.public.access.queries)
  • RE: Why cant I open a report using VB?
    ... Right, plugging the number into the criteria works, so the query itself is ... "Stuart At Work" wrote: ... know that the query is fine, and so is the data that the report is based on. ... is to check that the control that you refer to to populate the variable ...
    (microsoft.public.access.modulesdaovba)
  • RE: Filter Query by Year on a form
    ... If the check box does not affect what data are retrieved by the query, ... launch several different reports. ... it will launch that particular report say material cost report or ... If the user enters a year in the from year control and nothing in the to ...
    (microsoft.public.access.queries)
  • Re: Change of field name causes application to crash
    ... I can create a simple Sum query and get the same crash. ... UNION ALL query to simply UNION. ... > are part of the report. ... Sometimes when you have a control ...
    (microsoft.public.access.modulesdaovba)