H
hom370
I use some code in a form's current event to format some controls and to null
some controls depending on other control's values . I also have some code in
the form's before update event that checks to see if the form is dirty, and
if it is, it prompts whether to save the changes or not. Everything works
except that I am prompted whether to save changes even when I am only
scrolling through the records.
Private Sub Form_Current()
If FundType Is Null
FundStatus.Locked = False
FundStatus.Enabled = True
FundStatus = Null
FundStatus.BorderColor = 0
FundStatus.Locked = True
Command12.Visible = False
End If
setupformforbalance
setupformforstatus
End Sub
Here are the two subs that are called by form_current:
Private Sub setupformforbalance()
If FundBalance = 0 Then
FundStatus = "Setup"
FundStatus.BackColor = 13421587
Else
FundStatus = "Active"
FundStatus.BackColor = 2284862
End If
End Sub
Private Sub setupformforstatus()
If FundStatus = "Setup" Then
cmdPauseButton.Caption = "Activate"
FundStatus.BackColor = 13421587
End If
If FundStatus = "Active" Then
cmdPauseButton.Caption = "Pause"
FundStatus.BackColor = 2284862
End If
End Sub
Here is the code in the form's before update event:
If Me.Dirty Then
strMsg = "Are you sure you want to save changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then
Me.Undo
End If
End If
I need to keep my formatting, etc. in the form's current event, but is there
a way to avoid getting the prompt to save changes when I'm only scrolling
through records?
Thank you.
some controls depending on other control's values . I also have some code in
the form's before update event that checks to see if the form is dirty, and
if it is, it prompts whether to save the changes or not. Everything works
except that I am prompted whether to save changes even when I am only
scrolling through the records.
Private Sub Form_Current()
If FundType Is Null
FundStatus.Locked = False
FundStatus.Enabled = True
FundStatus = Null
FundStatus.BorderColor = 0
FundStatus.Locked = True
Command12.Visible = False
End If
setupformforbalance
setupformforstatus
End Sub
Here are the two subs that are called by form_current:
Private Sub setupformforbalance()
If FundBalance = 0 Then
FundStatus = "Setup"
FundStatus.BackColor = 13421587
Else
FundStatus = "Active"
FundStatus.BackColor = 2284862
End If
End Sub
Private Sub setupformforstatus()
If FundStatus = "Setup" Then
cmdPauseButton.Caption = "Activate"
FundStatus.BackColor = 13421587
End If
If FundStatus = "Active" Then
cmdPauseButton.Caption = "Pause"
FundStatus.BackColor = 2284862
End If
End Sub
Here is the code in the form's before update event:
If Me.Dirty Then
strMsg = "Are you sure you want to save changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then
Me.Undo
End If
End If
I need to keep my formatting, etc. in the form's current event, but is there
a way to avoid getting the prompt to save changes when I'm only scrolling
through records?
Thank you.