print in datasheet

O

oldLearner57

hi community

I can do a printout in datasheet view, however,
how do i include User Name and File directory?
is this possible?
any help appreciated :)

thanks community
 
T

Tom Wickerath

I think you will need to first create a report that is layed out in a
datasheet like view. Then add two unbound text boxes, one for the user and
one for the file directory. I would set the Can Grow property to Yes for the
text box used to display the file directory. Set the control sources for
these two text boxes as follows:

=CurrentUser() if you are using Access User Level Security, or
=fOSUserName() to get the user's NTUserID

and
=GetFileDirectory() to get the file directory.


In order to use the GetFileDirectory() function, create a new module. Copy
the function shown below, and paste it into this new module. Make sure to
give the module a name that is not the same as any existing procedure
(subroutine or function) in your database. Perhaps name it basUtilities:

Option Compare Database
Option Explicit

Public Function GetFileDirectory() As String

'Pick one of the following, comment the other line out:

'Full path (path + filename)
GetFileDirectory = CurrentDb.Name

'Path without filename
GetFileDirectory = CurrentProject.Path

End Function

In order to use the fOSUserName function, add the function available here to
your new module:

API: Get Login name
http://www.mvps.org/access/api/api0008.htm


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
Top