Hi
I am trying to get the user to exit my form (or move to th next record using the nav bar) without saving his changes
So far...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Exit without Saving?", vbYesNo) = vbYes Then
(This part I copied from MSA Help on 'OldValue')
Dim ctlTextbox As Control
For Each ctlTextbox In Me.Controls
If ctlTextbox.ControlType = acTextBox Then
ctlTextbox.Value = ctl.OldValue
End If
Next ctlTextbox
Exit Sub
Else
Cancel = True
End If
End Sub
But I get a RT Error 424 - "Object required"...on line 'ctlTextbox.Value = ctl.OldValue'
Any ideas - thanks in advance
I am trying to get the user to exit my form (or move to th next record using the nav bar) without saving his changes
So far...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Exit without Saving?", vbYesNo) = vbYes Then
(This part I copied from MSA Help on 'OldValue')
Dim ctlTextbox As Control
For Each ctlTextbox In Me.Controls
If ctlTextbox.ControlType = acTextBox Then
ctlTextbox.Value = ctl.OldValue
End If
Next ctlTextbox
Exit Sub
Else
Cancel = True
End If
End Sub
But I get a RT Error 424 - "Object required"...on line 'ctlTextbox.Value = ctl.OldValue'
Any ideas - thanks in advance