Ensuring all fields are filled before posting.

M

malycom

Hi

How can I ensure that all fields entered in a database are filled before
saving to a linked table.

When someone presses the Save button, if a field or fields are missing I
want a message box to state a field is empty or better still, what field/s
are missing, although simply getting it working would be fine.

I would also like to ensure that if they try to just close the form that the
linked table is not populated with the fields that have been filled if some
are blank.

Thanks in advance

Malcolm
 
M

malycom

Hi

If it makes any difference, these are the field names
CL_KEY
CL_FORMAL_NAME
CL_DEFAULT_CONTACT
CL_CATEGORY
CL_CONTROLENTITY
CL_PARTNER
CL_ADMINISTRATOR
CL_MANAGER
CL_CHARGE_VAT

I really don't want anyone to be able to save any data to the Linked Client
table if any one of these fields is missing.

Regards
 
A

Allen Browne

Open the back end database (i.e. the one that contains the tables you linked
to.) Set the Required property of the fields to Yes (in the lower pane of
table design.) It will not be possible to save the record unless the
required fields have a value.

If you don't want to do that, you will need to write some code in the
BeforeUpdate event procedure of the *form* (not the controls.) Use IsNull()
to test each field. Cancel the event if you're not happy.
 

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