problem exiting a form

  • Thread starter Thread starter Frederick Wilson
  • Start date Start date
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
 
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".
 
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
 
Back
Top