How do I hide an error message? cannot contain a Null value

M

M Skabialka

I have a main form bound to a table, with a subform bound to another table.
When I open the form I don't want to show any records; I want the user to
select one from a combo or click a button to initialize a new one.

However, when the form is on the new record, if I click anywhere on the
subform area (which shows no records at this point) I get error messages
about required fields being null, which they are because the user hasn't
selected a current record, or created a new one yet.

I can't seem to be able to trap this ugly error message so that it won't
show up on the screen.

"The field 'tblx.x' cannot contain a Null value because the required
property for this field is set to True. Enter a value for this field."

I've tried trapping on activate, current, click, etc on the form and the
subform but can't seem to catch it....
I tried DoCmd.SetWarnings False on Open...

It happens when you click the subform when there is a new record on the main
form and none on the subform.

Any advice on hiding this message?

Thanks,
Mich
 
M

M Skabialka

Also, when the user selects the option to create a new record (where some
fields are initialized to certain values) there is still no record on the
subform but the error message when you click there now changes to "Index or
primary key cannot contain a null value"

I would like this message to be hidden also becuase once the user chooses
the Save function on the main form, a new record is created in the subform
with certain fields preset to certain values, based on the main record (not
identical values, so not master, child relationship)

Thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top