Mike Hughes
Registered User.
- Local time
- Today, 15:26
- Joined
- Mar 23, 2002
- Messages
- 493
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 won't 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. What's wrong?
Private Sub Check5_AfterUpdate()
On Error GoTo HideStartupForm_Err
If Me.ActiveControl = True Then
CurrentDb.Properties("ShowPopUp") = "Don't 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") = "Don't Show" Then
Me.Check5 = True
Else
Me.Check5 = False
End If
End Sub
Private Sub Form_Timer()
DoCmd.Close
End Sub
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. What's wrong?
Private Sub Check5_AfterUpdate()
On Error GoTo HideStartupForm_Err
If Me.ActiveControl = True Then
CurrentDb.Properties("ShowPopUp") = "Don't 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") = "Don't Show" Then
Me.Check5 = True
Else
Me.Check5 = False
End If
End Sub
Private Sub Form_Timer()
DoCmd.Close
End Sub