J
Jeff Conrad
Hi,
Using Access 97 here.
I redesigned a couple of tables and added a couple of many-
to-many relationships. I added a tab control to my form so
the first tab would hold the main table's data and the
second tab would hold the two subforms. Each subform is
one-to-many with the main table. Everything works fine and
the data is populated correctly.
The problem I have found is when I go to a new record and
attempt to enter data into any of the two subforms BEFORE
entering data into the main table (form). I naturally get
the Access error saying:
"The field tblVendorOrderDates.VendorID can't contain a
null value because the Required property for this field is
set to True. Enter a value in this field."
Now this is not good. To my low-tech users this might as
well be ancient Greek. The possibility of them doing this
is quite real so I need to find a way around this.
I tried to trap for Error 3314 (Null key) in EACH subform
AND the main form's Form_Error event, but the Access error
comes up first!! After you click OK then my custom message
comes up. Not good.
What is the best way to handle this? Should I hide the
second tab if they are on a new record? When and how would
I make it visible again? Which event?
Any ideas are most welcome.
Thanks,
Jeff Conrad
Bend, Oregon
Using Access 97 here.
I redesigned a couple of tables and added a couple of many-
to-many relationships. I added a tab control to my form so
the first tab would hold the main table's data and the
second tab would hold the two subforms. Each subform is
one-to-many with the main table. Everything works fine and
the data is populated correctly.
The problem I have found is when I go to a new record and
attempt to enter data into any of the two subforms BEFORE
entering data into the main table (form). I naturally get
the Access error saying:
"The field tblVendorOrderDates.VendorID can't contain a
null value because the Required property for this field is
set to True. Enter a value in this field."
Now this is not good. To my low-tech users this might as
well be ancient Greek. The possibility of them doing this
is quite real so I need to find a way around this.
I tried to trap for Error 3314 (Null key) in EACH subform
AND the main form's Form_Error event, but the Access error
comes up first!! After you click OK then my custom message
comes up. Not good.
What is the best way to handle this? Should I hide the
second tab if they are on a new record? When and how would
I make it visible again? Which event?
Any ideas are most welcome.
Thanks,
Jeff Conrad
Bend, Oregon