Null Values

lorraine

Registered User.
Local time
Today, 13:31
Joined
Jul 25, 2000
Messages
27
Hi

I have a form with five subforms. If the user tries to enter any data in the subform without having created a record in the main form the error "Index or Primary key can't contain a Null Value" appears. How can I set up a user friendly message to stop this from happening and sen the user back to the main form!

thanks fro any help
Lorraine
 
I don't know if this helps, but I generally tackle situations like this by hiding or disabling the subforms/controls until the data in the main form is adequately filled in (testing the main form data in VBA), so the user can't get to the next step unless they create (or select) the parent record first.

HTH

Mike

[This message has been edited by Mike Gurman (edited 12-04-2000).]
 
Alternatively you could write some code to trap this error (Error No 3058) and here you could place a user friendly message.

Having said that I would also try Mike's suggestion first. It's far easier to control the flow of data input by enabling / disabling or showing / hidingscontrols once certain conditions are met
 
Thanks Mike and Robert for your replies

I will try both ideas

Regards
Lorraine
 

Users who are viewing this thread

Back
Top Bottom