Launch a form under the condition that field is not null

K

KesAFloyd

I would like to prevent accidental overwriting of data in my database.
I don't want to absolutely restrict overwriting, because in some cases
it may be necessary, but I'd like to prevent accidental errors.

My strategy is to have a popup that warns the user that they are about
to change a field that already has contents. They then choose whether
they want to overwrite or not. Basically, there are three macros,
where the first launches a form that has button options to run the
second and third. It is set to appear BeforeUpdate.

1. Open Alert:

OpenForm

2. Don't Overwrite:

Close
RunCommand (Undo)

3. Overwrite:

Close

The problem is, I don't know how to get this popup to only appear when
the field already has contents. I imagine this has something to do
with checking whether it's Null or not, but I don't know the syntax. I
would like this code to be universal, not specific to a single field
but rather across all the fields in the data entry form.

I have a hunch this requires VBA, but I'm not sure.

Thanks,
Alexandra
 
S

Steve Schapel

Alexandra,

I think you could set the Condition in your macro to:
[Screen].[ActiveControl].[OldValue] Is Not Null
 
K

KesAFloyd

That did it. Thank you.

Is there a general term for the [Screen], [ActiveControl] and
[OldValue] terms, so I could find a list of more of them? They look
useful.

Alexandra
 

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