Save

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Thanks, will it work Access 97 ??

Bill

*********************************

Aircode to check all the text boxes and combos on your form:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctl As Control
Dim strMsg As String

For Each ctl In Me.Controls
With ctl
If .ContorlType = acTextBox Or .ControlType = acComboBox Then
If Len(.ControlSource) > 0 Then 'Not unbound
If Asc(.ControlSource) <> 61 Then 'Not bound to an
expression.
If .Value = .OldValue Then 'Not unchanged.
'do nothing
Else
strMsg = strMsg & .ControlSource & " was " & _
Nz(.OldValue, "Null") & "; now " & _
Nz(.Value, Null) & vbCrLf
End If
End If
End If
End If
End With
Next

If Len(strMsg) > 0 Then
strMsg = strMsg & vbCrLf & "Save these changes?"
If MsgBox(strMsg, vbOKCancel) <> vbOK Then
Cancel = True
End If
End If
Set ctl = Nothing
End Sub
 
Back
Top