subform data validation

  • Thread starter Thread starter tag
  • Start date Start date
T

tag

I would like to know how to go through the records in a
SUBFORM which is bound to a table,for data validation
purpose.(Data Validation is done by user pressing
the 'Save' button after inputting the data on screen).
When data in a control is invalid, the cursor should go to
the incorrect control to let user know which data in which
record is incorrect and message in prompt. The validated
records are then saved into another table.


Thanks for help!
 
I would like to know how to go through the records in a
SUBFORM which is bound to a table,for data validation
purpose.

Set rs = Me.sfMySubForm.Form.Recordset

or

Set rs = Me.sfMySubForm.Form.RecordsetClone

Do While Not rs.Eof
...



HTH


Tim F
 
Just to add to Tim's post...

Of course there are situations where it makes sense to perform validation on
the save event
but mostly, it is better to perform subform validation at the subform level.
Imagine this situation
The user enters many records in your subform - say 5 records
say three records are incorrect.
When he clicks on save, he gets a message that record 1 is incorrect
then he gets another message saying record 3 is incorrect...

The ideal sitiatuion would be to validate each input in the subform and
determine if the data entered is valid.
this way the user knows immediately that the data entered is incorrect.

HS
 
Back
Top