problem exiting a form

F

Frederick Wilson

Access 97

I have a form in with one subform.

On the main form I need the user to input a date before continuing to the
controls on the subform. I have this taken care of with the onExit event of
that control.

The problem arises if the user inadvertently opens then data input form and
then exits the form. The OnExit event of the date control fires and will not
allow exit if the control is null.

I guess the question is, which events fire first. I have tried to trap this
in the forms Unload event but the control exit happens first.

Basically what I am trying to do is If dtDate is null and all controls on
subform are null, exit with no prompts. This might not be the best means.

Can some on help?

Thanks,
Fred
 
G

Graham Mandeno

Hi Fred

Don't use the Exit event. You can either check for a null value in your
Form_BeforeUpdate event, or set the date control's ValidationRule to "Not
Null".
 
F

Frederick Wilson

GREAT

I'll try that.

Fred


Graham Mandeno said:
Hi Fred

Don't use the Exit event. You can either check for a null value in your
Form_BeforeUpdate event, or set the date control's ValidationRule to "Not
Null".

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Frederick Wilson said:
Access 97

I have a form in with one subform.

On the main form I need the user to input a date before continuing to the
controls on the subform. I have this taken care of with the onExit event of
that control.

The problem arises if the user inadvertently opens then data input form and
then exits the form. The OnExit event of the date control fires and will not
allow exit if the control is null.

I guess the question is, which events fire first. I have tried to trap this
in the forms Unload event but the control exit happens first.

Basically what I am trying to do is If dtDate is null and all controls on
subform are null, exit with no prompts. This might not be the best means.

Can some on help?

Thanks,
Fred
 

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