Error Handling: Cancelling Data Entry

G

Guest

I need some guidance on error handling. (Access 2000 SP3)
A form opens up, and the user is supposed to enter something in the form
header before they start entering records. If they enter data in the body of
the form, I want to test that the header field has been filled in; if not, I
want to pop up a dialog box AND CANCEL their data entry, so it doesn't
generate another error. The user can hit Escape a couple of times to cancel
the data, but I want to spare them that.
Q1: Which property of the form do I use? "Before Insert"? "On dirty"?
Other?
Q2: What code should I put in the associated module to cancel the data
entry once I determine it is necessary?
Q3: Is there a guide to best practice on this kind of thing somewhere?
Thanks!
 
S

Steve Schapel

David,

I am not sure about "best practices", because requirements vary so
widely. But I think I would take a different approach here. I think I
would deny access to the Detail section of the form, either by setting
the Visible property of the section to No, or the Enabled property of
all the data controls to No, or some such, and use the After Update
event of the control in the header to toggle these property settings
only if the entry in the header is valid.
 
P

Pieter Wijnen

I agree

Pieter

Steve Schapel said:
David,

I am not sure about "best practices", because requirements vary so widely.
But I think I would take a different approach here. I think I would deny
access to the Detail section of the form, either by setting the Visible
property of the section to No, or the Enabled property of all the data
controls to No, or some such, and use the After Update event of the
control in the header to toggle these property settings only if the entry
in the header is valid.
 

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

Similar Threads


Top