[AccessD] ReadyToClose Function

Dan Waters df.waters at outlook.com
Thu Jul 23 15:26:15 CDT 2015


Hi Susan,

I do something like this on forms:
____________________________________
Private Sub butClose_Click()

    If ReadyToClose = False then Exit Sub

End Sub

Private Function ReadyToClose () As Boolean

    If txtNameFirst = "" Then
        txtNameFirst.SetFocus
        ReadyToClose = False
    End If

    If txtNameLast = "" Then
        txtNameLast.SetFocus
        ReadyToClose = False
    End If

    ReadyToClose = True

End Function
____________________________________

Within the ReadyToClose function you can come up with any conditional
situation you need.  You can also add a message if that helps your users.

Also, for every control on a Form I set the background color to a pale
yellow.  This helps people to quickly see what they need to do.

HTH,
Dan




More information about the AccessD mailing list