469,927 Members | 2,036 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Error not showing up

I hope This isnt to simple for this group but....

I am new to access and just finished a product. I added this code

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes
Then
'do nothing
Else
DoCmd.RunCommand acCmdUndo

on to my form to tell the users they were actually adding data. The
problem is, there are a few mandatory field in the table. If a user
dosent fill in these fields and closes the form, they dont get an
error that there is mandatory data missing, and the other information
is not saved. Is there something Im missing? is there a way to check
if the info is all there before I run this code?

Any help id greatly appricated.

Mike
Nov 12 '05 #1
1 1515
SB
civimike wrote:
I hope This isnt to simple for this group but....

I am new to access and just finished a product. I added this code

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes
Then
'do nothing
Else
DoCmd.RunCommand acCmdUndo

on to my form to tell the users they were actually adding data. The
problem is, there are a few mandatory field in the table. If a user
dosent fill in these fields and closes the form, they dont get an
error that there is mandatory data missing, and the other information
is not saved. Is there something Im missing? is there a way to check
if the info is all there before I run this code?

Any help id greatly appricated.

Mike

...........

im not new to access but i havent used it in many years m8,

would i be right im saying that there is a option in the General design
of the table for required yes/no ? group? sorry if im wrong!

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Kevin Murphy | last post: by
29 posts views Thread by =?Utf-8?B?SGVybWF3aWg=?= | last post: by
4 posts views Thread by lalith369100 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.