using VBA to create a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i would li ke to know, how to create a report in VBA??
I did my form in access, and that for mi have a checkbo and when is true,
appear one button to copy th contain of the fields and create report with
that values.
for example, i have a field call NAME and other one call ADRESS and a
checkbox. if its true appears on button (called OK) ad this button creates a
report with the contain of the fields NAME and ADRESS. the name of the report
can be "report"_Date --> todays date.
any sugestion.
thanks
 
Hi,
to create report using VBA - you can use óreateReport function, see online
help for more info.
perhaps you can also consider creating one report, and then filter it for
certain date, this is much more easy approach
 
hi,
thanks, you saiyng create a report in the assistent view or struture view??
if yes, how can i get only the information of the two fields and put in the
report??
i'm asking because i'm new in VBA.
thanks

"Alex Dybenko" escreveu:
 
CreateReport - creates report in design veiw, then you can create controls
there using CreateReportControl
 
Bruno said:
i would li ke to know, how to create a report in VBA??
I did my form in access, and that for mi have a checkbo and when is true,
appear one button to copy th contain of the fields and create report with
that values.
for example, i have a field call NAME and other one call ADRESS and a
checkbox. if its true appears on button (called OK) ad this button creates a
report with the contain of the fields NAME and ADRESS. the name of the report
can be "report"_Date --> todays date.


This is almost always unnecessary and generally a bad idea.

Please listen to Alex's idea of precreating a single report
and just filtering the data for the daily output.
 
ok, until know i'am little confused, because i don't know how to filter the
name of the report, but i think too, tha t you aren't understanding my
question, i will say again.
what i am looking it's how can i create a report in VBA when i'm click in
the OK button. that report will be correspond two fields, and the contain of
that two fields will go to the report, and so on on.

i'm sorry if i can't understand but i knew in VBA. THANKS

"Marshall Barton" escreveu:
 
I don't understand either.

Alex has already provided good advice and, even though he
advised against it, he did answer your question.
 
What everyone responding to you here (all of whom are to my personal
knowledge very capable Access developers), are telling you is that it is
neither necessary nor smart to _create_ a new report each time. You seem to
be "locked in" on a solution of "creating a new report", which is, I repeat
what they have said, NOT NECESSARY AND NOT A GOOD IDEA.

Your reports are going to be identical in design, differing only in the data
that is displayed, and all you need to do is to use the unique
identification of the record in the form to limit the records
printed/previewed in the report.

You will _run_ the already-created report (which you create visually, in
design view) using the DoCmd.OpenReport command (to see the Help on this, in
the module window, put the cursor in the command and press F1... you will
use the WhereCondition to specify the record you want printed).

Read carefully... you do not need to be experienced in VBA to understand
this.

Larry Linson
Microsoft Access MVP
 
Back
Top