code for username,date and time

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!!
 
S

Stockwell43

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
 
D

Douglas J. Steele

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),"
 
S

Stockwell43

Douglas, you are the man!! Works like a gem and I thank you again Sir for
your help!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top