UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Elegant Way To Capture Date And Time Of A Pdf Print From Access, Access 2010    
 
   
SemiAuto40
post Feb 15 2018, 10:38 AM
Post#1



Posts: 640
Joined: 3-April 12
From: L.A. (lower Alabama)


Want to capture this whenever anyone on a multi user split Access database prints a PDF which is located (attached) inside the database.

Thank you so much.
Go to the top of the page
 
doctor9
post Feb 15 2018, 10:44 AM
Post#2


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


SemiAuto40,

Assuming they are using a command button that is dedicated to printing the PDF file, here's a basic table structure:

tblPrintLog
PrintLogID [Autonumber, Primary Key]
dtePrintDateAndTime - Default value: Now()
strUserName

In the command button's Click event, add a new record to the table:

CODE
        strSQL = "INSERT INTO tblPrintLog ( strUserName ) " & _
            "VALUES ('" & WhoIsLoggedOn() & "', True );"

        CurrentDb.Execute strSQL, dbFailOnError


Replace WhoIsLoggedOn() with the name of a function that will return the current username. If you don't have one, I would recommend this one, from The Access Web, which retrieves the username that the user logged into the network with.

Hope this helps,

Dennis
Go to the top of the page
 
GroverParkGeorge
post Feb 15 2018, 10:50 AM
Post#3


UA Admin
Posts: 34,106
Joined: 20-June 02
From: Newcastle, WA


Further to Dennis' comment. Implied in it are two things:

1) You have to have a log table to log events or you can't get the information.
2) Users can only print PDFs one way--your way.

Also, it's probably true that "someone" will figure out how to print a PDF without going through your form, so you have to think about, and plan for that as well.

Go to the top of the page
 
SemiAuto40
post Feb 15 2018, 11:49 AM
Post#4



Posts: 640
Joined: 3-April 12
From: L.A. (lower Alabama)


Thank you all for your help. uarulez2.gif
Go to the top of the page
 
SemiAuto40
post Feb 16 2018, 03:33 PM
Post#5



Posts: 640
Joined: 3-April 12
From: L.A. (lower Alabama)


The PDF or in my form as attachments such that when the user clicks on them the attachment box opens and the PDF can then be viewed. From there it seems maybe I cannot track the print but possibly the opening and viewing. Are you suggesting that I use a button instead to serve the function that the attachment icon does in Access?
Go to the top of the page
 
doctor9
post Feb 16 2018, 06:02 PM
Post#6


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


SemiAuto40,

If you know of a way to simply select and print an attachment without allowing the user to actually open it, I'd go with that method. I don't personally use the Attachment datatype, so I have no advice on that, I'm afraid.

Based on your reply, it sounds like you're allowing too much control to your users at this point. By allowing them to simply open the file, it's basically the same as giving them full access to your data tables and then wondering who changed or deleted a value in a record while they had that level of access. Since you didn't control their access to the table via a form, there was no way to know that information.

Hope this helps,

Dennis
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th December 2018 - 12:17 AM