Data entry form with validation

D

Dave

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
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top