Signature button

L

Lori

is it possible to create a button on a form that will enter in a user's name
and the current date into a signature field?
 
J

John Vinson

is it possible to create a button on a form that will enter in a user's name
and the current date into a signature field?

Where would it get the name? How can Access tell who is sitting at the
keyboard?

You should certainly have *two* fields, not one; a signature is one
thing, a date is a different thing. You can store the date and time of
the button click by using code like

Private Sub cmdSign_Click()
Me!txtUser = <call a function to get user name>
Me!txtTimestamp = Now
End Sub

where txtTimestamp is the name of a textbox bound to the date/time
field.

John W. Vinson[MVP]
 
L

Lori

Okay, now that I have everyone set to log in with unique passwords. I have
the final part to my signature, can the database pull the user name from that
for the coding or will I need to have a pop up asking them to enter their
name? Which way would be the most foolproof? I don't want the wrong people
signing things as someone else? What specifically did you mean when you said
"call function?"
 
L

Lori

Will this use their access login? I've got all of the users set up? Should I
assign this to a text box or a command button? I've tried a couple of
different ways but I can't get it to work.

I've used some of what John gave me for the signature date but without one
part working, naturally part 2 won't work.
 
D

Douglas J. Steele

To get their Access login, use the CurrentUser() function (instead of the
code from the first reference)

Whether you assign the value to a text box, or strictly put it in a variable
in the code associated with the Click event of a command button is entirely
up to you and your requirements. If you don't need the information anywhere
else, there would seem to be no need to assign it to a text box.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
Top