C
Chad
Hello, I am running this code in my WelcomeForm On Open event and when a
person is denyed access to the database and before OR after the database
closes I would like a outlook email window to come up so they can email me.
what and where would I add the code to the code below? Thanks!
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim rstV As Recordset
Dim stDocName As String
Dim stLinkCriteria As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbl_LoginID", dbOpenDynaset)
If Not IsNull(Me.Text_Network_User) Then
rst.FindFirst "strEmployeeUserID = '" & Me.Text_Network_User & "'" &
" And strEmployeeUserID = '" & Me.Text_Network_User & "'"
If rst.NoMatch Then
MsgBox "You do not have access to this database!!! " & Chr(13) & _
"Please contact the Database Adminstrator for assistance.",
vbOKOnly + vbCritical, "Logon Denied"
DoCmd.Quit
Else
stDocName = "WelcomeForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End Sub
person is denyed access to the database and before OR after the database
closes I would like a outlook email window to come up so they can email me.
what and where would I add the code to the code below? Thanks!
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim rstV As Recordset
Dim stDocName As String
Dim stLinkCriteria As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbl_LoginID", dbOpenDynaset)
If Not IsNull(Me.Text_Network_User) Then
rst.FindFirst "strEmployeeUserID = '" & Me.Text_Network_User & "'" &
" And strEmployeeUserID = '" & Me.Text_Network_User & "'"
If rst.NoMatch Then
MsgBox "You do not have access to this database!!! " & Chr(13) & _
"Please contact the Database Adminstrator for assistance.",
vbOKOnly + vbCritical, "Logon Denied"
DoCmd.Quit
Else
stDocName = "WelcomeForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End Sub