print report automatically

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

Guest

Hi,
I have a table that keeps on inserting record at backend. I would like to
print out a report automatically (without pressing any button) whenever there
is a record with the field value "PRINT".

Table A

Field 1 Field 2 Field 3
-------------------------------------
a b 1
a c 2
a PRINT 1 <-------- print report here
b c 1
b c 2
b PRINT 3 <---------print report here
d d 1
d d 2
............

Is it possbile to achieve this?? Thanks in advance.
 
Hi,
I have a table that keeps on inserting record at backend. I would like to
print out a report automatically (without pressing any button) whenever there
is a record with the field value "PRINT".

Table A

Field 1 Field 2 Field 3
-------------------------------------
a b 1
a c 2
a PRINT 1 <-------- print report here
b c 1
b c 2
b PRINT 3 <---------print report here
d d 1
d d 2
...........

Access is an event driven environment, and tables don't have Events associated with them, they're simplly storage
containers. Generally you'd check for this in the frontend and fire the print event as needed, assuming you're entering
data through Forms or VBA instead of entering data directly into the table. This would fire your report:

DoCmd.OpenReport "YourReportName"

Note that the OpenReport method accepts Where clauses and Filters, so you could apply that if you want to limit the
records shown on the report.

If you're using some other frontend (like VB or ASP) then the same basic logic would apply ... check for the record when
your code Inserts or Updates a record, and then fire the print even as needed.


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Thanks Scott.

Actually the records are inserted by another programme, that is not develop
by our company. We have to "catch" for the records it inserted to the MS
Access Database. Just have no idea on how to fires the OpenReport when the
field values match....
 
Back
Top