Judy:
I think I've already done that in my original reply. The only
difference is that your database is a single file, but as its on a
network everyone will have to log in, so will have a user name you can
use to identify them. Here's what I said, modified very slightly to
take account of the one-file set up:
1. Create separate image files of every user's signature.
2. In the database create a table, UserSignatures
say, with two text columns UserName and ImagePath. Each row in this
table will contain a user's Windows user name, i.e. the name with
which they log in to the system, and the full path to the image file
of their signature, which will be in a shared folder on the network.
3. Add the following module to the database which enables you to call
the Windows API to get the current user's user name:
''''module basGetUser''''
''''module starts''''
Option Compare Database
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal _
lpBuffer As String, nSize As Long) As Long
Public Function GetUser() As String
Dim strBuffer As String
Dim lngSize As Long, lngRetVal As Long
lngSize = 199
strBuffer = String$(200, 0)
lngRetVal = GetUserName(strBuffer, lngSize)
GetUser = Left$(strBuffer, lngSize - 1)
End Function
''''module ends''''
4. Add an image control to your form or report where you want to show
the signature.
5. In the form's or report's module's Open event procedure set the
picture property of the image control with:
Dim varPath as Variant
Dim strCriteria as String
strCriteria = "UserName = """ & GetUser() & """"
varPath = DLookup("ImagePath", "UserSignatures", strCriteria)
If Not IsNull(varPath) Then
Me.YourImageControl.Picture = varPath
Else
Me.YourImageControl.Visible = False
End If
I can't really see what I can add to that to make it any clearer, but
if you're really stuck, then mail me at:
kenwsheridan<at>yahoo<dot>co<dot>uk
and I'll put together a simple little file for you to demonstrate how
it can be done.
BTW I really would recommend splitting your database. It only takes a
few moments with the wizard. You can then put a copy of the front end
on each user's machine, which is not only more efficient, but a lot
safer, as if one copy of the front end becomes corrupted the data in
the back end is untouched, and you simply have to replace the front
end with a new copy from a 'master' copy kept somewhere safe. It also
means you can back up the data regularly without backing up all the
unchanging objects like forms, reports etc. You do back up regularly,
don't you!!!
Ken Sheridan
Stafford, England