I have a form(warning) which appears when a record is changed on another form. This form has a check box to allow the user to turn the form off so it wont appear the next time a record is changed.
This is the AfterUpdate code for the check box. Problem is, you can check the box, but the next time a record is changed the box appears again, checked box and all. Whats wrong?
This is the AfterUpdate code for the check box. Problem is, you can check the box, but the next time a record is changed the box appears again, checked box and all. Whats wrong?
Code:
Private Sub Check5_AfterUpdate()
On Error GoTo HideStartupForm_Err
If Me.ActiveControl = True Then
CurrentDb.Properties("ShowPopUp") = "Dont Show"
Else
CurrentDb.Properties("ShowPopUp") = "Show"
End If
DoCmd.Close
Exit Sub
HideStartupForm_Err:
Const conPropertyNotFound = 3270
If Err = conPropertyNotFound Then
Dim db As DAO.Database
Dim prop As DAO.Property
Set db = CurrentDb
Set prop = db.CreateProperty("ShowPopUp", dbText, "Show")
db.Properties.Append prop
Resume Next
End If
End Sub
Private Sub Form_Load()
If CurrentDb.Properties("ShowPopUp") = "Dont Show" Then
Me.Check5 = True
Else
Me.Check5 = False
End If
End Sub
Private Sub Form_Timer()
DoCmd.Close
End Sub