Navigating from a new record without required field filled

D

Don

I have a form where users enter data for a sale unit. If they click the
Add New Record button, then want to navigate away from that new record
without saving data, they get messages that tell them that SaleUnitID
is a required field and they must enter something. I've been telling
them to click Edit>Undo on the toolbar.

I just want them to be able to navigate away from a new record if they
decide that they do not need to enter it. I would like to allow them to
be able to use the Previous Record button and Search button to navigate
away from the new record if they want to leave it without adding a new
record. They feel trapped right now if they decide to leave the new
record without entering data.

I originally thought that I would change the SaleUnitID so that it is
not required but this left me with empty records in the underlying
table.

Can I code a Me.Undo statement in those buttons events that allows them
to leave that record if the SaleUnitID is null? If so what should it
look like? I am not worried about losing other data in the record
because if the SaleUnitID is null then no other data should exist.

Thanks in advance for any input.
 
R

Rick Brandt

Don said:
I have a form where users enter data for a sale unit. If they click
the Add New Record button, then want to navigate away from that new
record without saving data, they get messages that tell them that
SaleUnitID is a required field and they must enter something. I've
been telling them to click Edit>Undo on the toolbar.

I just want them to be able to navigate away from a new record if they
decide that they do not need to enter it. I would like to allow them
to be able to use the Previous Record button and Search button to
navigate away from the new record if they want to leave it without
adding a new record. They feel trapped right now if they decide to
leave the new record without entering data.

I originally thought that I would change the SaleUnitID so that it is
not required but this left me with empty records in the underlying
table.

Can I code a Me.Undo statement in those buttons events that allows
them to leave that record if the SaleUnitID is null? If so what
should it look like? I am not worried about losing other data in the
record because if the SaleUnitID is null then no other data should
exist.

Thanks in advance for any input.

The only reason they would get that message when all they have done is
navigate to the new record position is because you have code or a macro that
is actually setting a value and "starting" the creation of a new record.
There should be no reason to do such a thing so you shoudl remove that.
 
D

Don

I have a bunch default values setting for fields on Form_Current. Those
are probably my problem huh?

Don
 
R

Rick Brandt

Don said:
I have a bunch default values setting for fields on Form_Current.
Those are probably my problem huh?

It wouldn't be if you were actually setting the DefaultValue property. If
you are setting actual values then yes, you are dirtying the record every
time you navigate. Definitely not a good idea.
 

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