Need Help with required field error message

  • Thread starter Thread starter Simone
  • Start date Start date
S

Simone

Hello

I have been reading a lot post on this subject. I posted yesterday but
my post hasn't showed up.

I have 4 forms where I will have more than one required field.
I have been reading about putting on the beforeUpdate event a code
where it checks the field if is null then a message shows up. Well
that doesn't work for me since my form has already an ID assigend to
the record and when the form opens up the message already shows up.

I have tried using the error event BUT I still get the access error
message just by moving through fields (just by getting the focus to
the required field) and the customized error message in my error event
sometimes pops up and sometimes not.

I am really confused with this...it is driving me crazy. I know the
best way is setting required to yes in the table but it works weird.
Please if something has been successful with this please show me how
to step by step, thanks :)

how it works:
I have a pop up form that checks if a Patient ID is correct before
going to the data entry forms and if yes it already assign the ID to
the form so the user doesn't have to type it again. So the record gets
created but if no value is enterend in the required field it gives the
message even though I haven't got to the field yet.


Please Please help.
Thanks
Simone
 
I think you should move the error checking code from the BeforeUpdate of
the *control* to the BeforeUpdate of the popup *form* itself. This way,
it will check for data entered only when the form is ready to put its
data into the table.

Pavel
 
Thanks for your reply but I don't think it will work since the popup
form closes once the user clicks on the button to continue to the
data entry form.

Thanks anyway.
 
Simone, Standard Access error messages will come up before custom messages.
If you have the text box set to required then when ever you leave this box,
it will perform the check before letting you to go to another field. If you
want to do this type of checking it is best to leave the required option to
no. Do your checking in the code of the button first, then close the popup
and open the next form.

Kelvin
 
Back
Top