I want to be able to set the allow edits property on a different form when a button is selected on the current form. The code is below and it runs without error, but when I open the form I'm trying to set, the allow edits property is Yes and not No.
Any ideas would be great. Thanks!
Private Sub NotifyAM_Click()
Dim cnn As New ADODB.Connection
Dim rstTo As New ADODB.Recordset
Dim answer As Integer
Dim EmailText As String
Dim ToReceiver, Subject As String
Subject = "ED Updated Project Aging Data"
EmailText = "The Project Aging Information has been updated and ready for your review. Thank you!"
Set cnn = CurrentProject.Connection
rstTpen "Select * from Tlkp_Employee where RoleID in (6)", cnn, adOpenDynamic, adLockOptimistic
Do While Not rstTo.EOF
Dim toStr As String
Do While Not rstTo.EOF
toStr = toStr & rstTo("EmployeeEmailAddress") + ";"
rstTo.MoveNext
Loop
'DoCmd.SendObject acSendQuery, "qry_AM_Export_of_Data", acFormatXLS, toStr, , , Subject, EmailText, False
DoCmd.SendObject acSendNoObject, , , toStr, , , Subject, EmailText, False
Loop
'Form_frm_Consultant_Updates.AllowEdits = False
End Sub
Any ideas would be great. Thanks!
Private Sub NotifyAM_Click()
Dim cnn As New ADODB.Connection
Dim rstTo As New ADODB.Recordset
Dim answer As Integer
Dim EmailText As String
Dim ToReceiver, Subject As String
Subject = "ED Updated Project Aging Data"
EmailText = "The Project Aging Information has been updated and ready for your review. Thank you!"
Set cnn = CurrentProject.Connection
rstTpen "Select * from Tlkp_Employee where RoleID in (6)", cnn, adOpenDynamic, adLockOptimistic
Do While Not rstTo.EOF
Dim toStr As String
Do While Not rstTo.EOF
toStr = toStr & rstTo("EmployeeEmailAddress") + ";"
rstTo.MoveNext
Loop
'DoCmd.SendObject acSendQuery, "qry_AM_Export_of_Data", acFormatXLS, toStr, , , Subject, EmailText, False
DoCmd.SendObject acSendNoObject, , , toStr, , , Subject, EmailText, False
Loop
'Form_frm_Consultant_Updates.AllowEdits = False
End Sub