code for username,date and time

  • Thread starter Thread starter Stockwell43
  • Start date Start date
S

Stockwell43

Hello,

I have a field called "Loan Boarder". I need a simple piece of code so that
when the boarder clicks on the command button, it will automatically fill in
their user name, current date and current time. I can get it to fill in the
date and time by using Now() but don't know how to get the user name with it
in the same field.

Thanks!!
 
Hi Douglas,

Thank you for the reply. You've always helped out a lot in the past and I
was wondering if you could look at the code below and tell me why I get a
Compile Error. I have Dalia, Alpheretta and Myrna in one line and Sharon and
Jeanette in another. Let me just say this, if I put all the names on the same
line it works fine. In fact, that is how I am using it now and am not having
a problem. But, I would like to know why I am unable to separate it into two
lines. Also, if I have more name later, I want to be able to add without
running a mile long line. Any help would be appreciated!!

Thanks!!!

Private Sub Command39_Click()
On Error GoTo EH
Dim SendTo As String, SendCC As String, MySubject As String, MyMessage
As String
SendTo = ""
SendCC = "(e-mail address removed),
(e-mail address removed), (e-mail address removed) & _ "
(e-mail address removed), (e-mail address removed),"
MySubject = "Additional Information Needed"
MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
Me.CustomerLast & vbCr & Me.ErrorCode & _
vbCr & Me.Comments
DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
MyMessage, True

EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If
End Sub
 
When you use a line continuation character, you have to end the string and
start it again on the next line.

Something like:

SendCC = "(e-mail address removed)," & _
"(e-mail address removed)," & _
"(e-mail address removed)," & _
"(e-mail address removed), (e-mail address removed),"
 
Douglas, you are the man!! Works like a gem and I thank you again Sir for
your help!!!
 
Back
Top