Saving Record Problem

mansonpj

Registered User.
Local time
Today, 22:12
Joined
Nov 5, 2003
Messages
18
Can someone help, i have a form the when you click save if all mandatory are not entered then it posts a message, which works fine, but when i click save (and all fields are correct) and the message comes up "Are these details correct?" if i click no, it still saves into the table.

The code is as below.


MsgBox "Are these details correct?", vbYesNo, "Confirm details"
DoCmd.GoToRecord , , acNewRec

Anyone help me

Paul
 
It doesn't know or assume what you want done. You have to tell it. Here's an example:
Code:
 Dim msg, button, title, response
 msg = "Vehicle is Shopped - Do you want to dispatch anyway?"
 button = vbYesNo + vbDefaultButton2
 title = "Vehicle Shopped!"

 response = MsgBox(msg, button, title)
 If response = vbYes Then
   'what to do if yes
 Else  
   'what to do if not
 End If
 
You need to use the BeforeUpdate event of the form to prevent bad records from being saved. Put your edits there. If there are problems, cancel the update with -
Cancel = True

Search for posts by me on the BeforeUpdate event for more details.
 
Cheer guy's

Pat used some of your other stuff that i found, great help thanks
 

Users who are viewing this thread

Back
Top Bottom