Add email VBA to existing code

  • Thread starter Thread starter Guest
  • Start date Start date
Text_Network_User is pre filled in using a module to get thier PC Login. How
would I log whats in that text box before they get the pop up that they cant
enter the database? I gave up on the email thing! Sure would have ben nice
though...Thanks!
 
Dim strSQL As String

strSQL = "INSERT INTO LogTable(UserID, EventDtm, Comment) " & _
"VALUES(""" & Me.Text_Network_User & """, " & _
Format(Now(), "\#yyyy\-mm\-dd hh\:nn\:ss\#") & ", " & _
"Unauthorized Database Access" & ")"
CurrentDb.Execute strSQL, dbFailOnError

This assumes you have a table named LogTable with (at least) three fields:
UserID (a text field), EventDtm (a date/time field) and Comment (a text
field)
 
Could I add this to the code we have been working on? If so where in the code
would it go? Thanks!
 
You'd put that code instead of the code you used to have to send the e-mail.
 

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

Back
Top