Macro to change Yes/No checkbox to No when exiting record

O

Owl

I have a Yes/No checkbox field that must change to No when the user exits the
record.

I don't know what to put in the macro.

I also don't know where it should go - On Close?
 
S

Steve Schapel

Owl,

If the record has been newly entered, or edited, then probably the Before
Update event of the form is the appropriate spot for your macro.

Action: SetValue
Item: [NameOfYourYesNoField]
Expression: 0

By the way, on the face of it, this is a very unusual requirement - so my
curiosity has been piqued.
 
O

Owl

Couldn't answer sooner. Hard drive failed. Got new one. Spent time getting
all back on to computer again. I should still have your email address (and
will reply there - and here when Telkom has finished working on cables under
the sea) because now my internet connection keeps on breaking pretty much
every few seconds. Now and then I am a little luckier.

Steve Schapel said:
Owl,

If the record has been newly entered, or edited, then probably the Before
Update event of the form is the appropriate spot for your macro.

Action: SetValue
Item: [NameOfYourYesNoField]
Expression: 0

By the way, on the face of it, this is a very unusual requirement - so my
curiosity has been piqued.

--
Steve Schapel, Microsoft Access MVP


Owl said:
I have a Yes/No checkbox field that must change to No when the user exits
the
record.

I don't know what to put in the macro.

I also don't know where it should go - On Close?

.
 
O

Owl

Thanks, I tried what you said but it didn't work.

The explanation for my strange request is the following:

After each of 5 payments, a record gets locked. There is a form on the
front end of the computer of an administrator (but not on the data capturers'
computers) which allows the administrator to lock a record.

That allows the data capturer to enter the next payment and other fields on
a previously locked record. As soon as the data capturer has entered that
record it needs to be locked again. (Unlocked = No).

Thanks for your input. Please could you help me again.

Steve Schapel said:
Owl,

If the record has been newly entered, or edited, then probably the Before
Update event of the form is the appropriate spot for your macro.

Action: SetValue
Item: [NameOfYourYesNoField]
Expression: 0

By the way, on the face of it, this is a very unusual requirement - so my
curiosity has been piqued.

--
Steve Schapel, Microsoft Access MVP


Owl said:
I have a Yes/No checkbox field that must change to No when the user exits
the
record.

I don't know what to put in the macro.

I also don't know where it should go - On Close?

.
 
S

Steve Schapel

Owl,

Thanks for the further explanation. Makes sense.

As for other help... depends what you mean, precisely, by "didn't work".
 
O

Owl

By didn't work, I meant that nothing happened. It turned out to be the same
problem I have had since about October 2009 when I couldn't use certain
macros, such as SetValue since upgrading to 2007 (with an Upgrade package,
not a full package). So, in the meantime, I put an Update query that did the
job on Close Form.

Subsequently, purely by chance, I solved the macro/2007 problem. I ran
Microsoft Diagnostics - and HEY PRESTO! - all my SetValue and Warnings Off
macros suddenly had the effect they were supposed to, instead of (I think it
was nothing that happened or an error message or something).
 

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