Validating data on continuous form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a continuous form based on a query. Each time a column is updated on
any row I need to validate this against all other rows on the form.

I need this because certain combinations of data are invalid.

Is there a way to do this by checking the atcual data rows on the form
rather than the base tables?

If I find an error, how do I handle it? Obviously I must prevent the data
from being saved in an invalid state.
 
You should check the values on the before update event of the form.

The code will contain the following
========================================
on error goto BeforeUpdate_Err
CheckData
If CheckData = False then
msgbox "Data Invalid"
cancel = True ' Wont let you move to the next record, or exit the form
exit sub
End if

BeforeUpdate_Exit:
exit sub
BeforeUpdate_Err:
msgbox error
resume BeforeUpdate_Exit
=========================================


Now, about the CheckData, I don't know what you are trying to do, so I can't
help you there.
From what it sound like, you want to check all the records except of the
current one.
It sound like you need a query to do that.
If you need help with the data validation then we need to know what you are
trying to do.
 
What sort of check do you want to make against the other rows in the form's
recordset? Since this is a continuous form, is it a subform? If so, is it
linked to the parent form so that its records are filtered to be relevant to
the current parent record?
 
Back
Top