I'll have to think of some other way, as the "CheckSaveStatus" function gets invoked when neither of the tb's referenced would have the focus. Access bombs with a 2185 if I try.
Code:
Private Function CheckSaveStatus() As Boolean
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Check minimum requirements for a save operation
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
CheckSaveStatus = (Len(tbNewDate & "") > 0 And intNewTTypeID > 0 And _
(Len(Me.tbNewDescription.Text & "") > 0 Or Len(Me.tbNewMemo.Text & "") > 0))
End Function
This works as originally intended:
Code:
Private Sub tbNewMemo_Change()
strMemo = Me.tbNewMemo.Text
If CheckSaveStatus Then ToggleCmdVisibility
End Sub
Private Sub tbNewDescription_Change()
strDescription = Me.tbNewDescription.Text
If CheckSaveStatus Then ToggleCmdVisibility
End Sub
Private Function CheckSaveStatus() As Boolean
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Check minimum requirements for a save operation
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
CheckSaveStatus = (Len(tbNewDate & "") > 0 And intNewTTypeID > 0 And _
(Len(strDescription) > 0 Or Len(strMemo) > 0))
End Function
Both strDescription and strMemo are Dim'd String and are both initialized and refreshed as ZLS as appropriate.