472,119 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 1576
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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.