Data entry form with validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I designed that I will be using for "data entry". The form has multiple combo and text boxes on it that have their recordsource property set to thier respective database fields. I want to have a finish button that will ask the user if the info the enetered is corect and want it written to the database. If they click "No" I dont want anything passed to the database, if they click yes, pass the data to the correct fields. It seems easy but I'm having trouble..Thanks in advance..Dave
 
There are so many ways that the record in a bound form can be saved. The
only guaranteed way to intercept it and ask for confirmation is to use the
Before Update event of the form.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbOkCancel) = vbCancel Then
Cancel = True
Me.Undo
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Dave said:
I have a form that I designed that I will be using for "data entry". The
form has multiple combo and text boxes on it that have their recordsource
property set to thier respective database fields. I want to have a finish
button that will ask the user if the info the enetered is corect and want it
written to the database. If they click "No" I dont want anything passed to
the database, if they click yes, pass the data to the correct fields. It
seems easy but I'm having trouble..Thanks in advance..Dave
 
Back
Top