Check Data before Saving.

N

Nad

Hi Guys!
I made a form with a sub form on it ( to add new record). I put a “Saveâ€
command button on the main form to save & close the form. My question is
that, before saving & closing the form it should check that all the fields in
the main form & sub form have the value, otherwise it should display a
message box to the user to fill all the information on both the form. All the
values are mandatory. The record source of both form are two different table.
Please… help.
Thanks & Regards,
 
A

Al Campagna

Nad,
Since your only checking for entries upon completion the main and sub
forms,
making those fields Required in table design would accomplish that.

The only difference as to what you wanted is that the main form will
"bark" on it's "requireds" when you fill in the main, and then access the
subform.
And... the sub will bark on it's own update (like moving form sub record
to record... or back to the main)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
K

Klatuu

You will need to use the Before Update event in the subform to do whatever
validation tests you want on the subform data. And the Before Update event
in the main form to validate its data.
 

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