G
Guest
I have a main form with a subform. The subform is in datasheet view.
Basically what I am trying to prevent is a user from submitting their
information when one of the fields in the subform has a certain value (call
it aaa for ease). So, if they hit submit and the field that I am trying to
not let have aaa in it has it, they won't be able to move on. The problem I
am having is that it easy to test this for the last record inputted in the
datasheet, but not for previous ones (e.g. if they had entered two or more
records in the subform). So, I have been trying to play around with the
subform and the submit button that is on the mainform, but with no success!
It would be helpful if there was a Before On Current event for a form (e.g.
before they go to the next record, test if aaa is there), but I don't think
this event exists. Any help would be appreciated. Probably would be easiest
to put code in the submit button on the mainform, but don't know if its
possible to say "if any of the records in the datasheet view (not past
records already stored in the table, just ones they have just entered and are
still currentely showing in the subform) have aaa, then...."
Basically what I am trying to prevent is a user from submitting their
information when one of the fields in the subform has a certain value (call
it aaa for ease). So, if they hit submit and the field that I am trying to
not let have aaa in it has it, they won't be able to move on. The problem I
am having is that it easy to test this for the last record inputted in the
datasheet, but not for previous ones (e.g. if they had entered two or more
records in the subform). So, I have been trying to play around with the
subform and the submit button that is on the mainform, but with no success!
It would be helpful if there was a Before On Current event for a form (e.g.
before they go to the next record, test if aaa is there), but I don't think
this event exists. Any help would be appreciated. Probably would be easiest
to put code in the submit button on the mainform, but don't know if its
possible to say "if any of the records in the datasheet view (not past
records already stored in the table, just ones they have just entered and are
still currentely showing in the subform) have aaa, then...."