MoveToControl

G

Guest

Access Xp DB - On a form I have a macro executed AFTERUPDATE on a check box
field - the macro checks to see if the check box is checked or unchecked. If
checked, it populates other fileds on the same form using the setvalue
command. If unchecked, it should delete values in other fields on the same
form using the GOTOCONTROL and then RUNCOMMAND = DELETE commands. All works
fine when the check box is checked - it errors when I remove the check

The problem I am having is when the macro detects an UNCHECKED box - then it
is supposed to move ahead to 6 different fields on the same form
(GOTOCONTROL) and then RUNCOMMAND = DELETE the value in each of these fields.
I get an error message that specifies the 1st GOTOCONTROL field is not
present (that's when I use the full syntax path to it). If I use just the
field name, then I get an error that suggests I remove the action that forces
a save (i.e. the GOTOCONTROL).

I searched for other posts related to this, found just a couple, but none of
them answer my problem - can anyone offer some insight?
 
S

Steve Schapel

Maureen,

I am puzzled as to why a GoToControl action "forces a save", but without
specific details of the macro, and the error message, it would be hard
to help with this.

Since you are using SetValue actions in your macro in the case of the
checkbox being ticked, it would seem logical/consistent I suppose to
also use SetValue actions to set the controls to Null when the checkbox
is unticked. I am not sure that using a RunCommand/Delete action will
do what you want.

But for myself, I would prefer to make an Update Query to manipulate the
data, and then the macro would be using an OpenQuery action to run the
update.
 
G

Guest

Good suggestion to use SetValue - and it works! I should have seen that one.
Thanks very much for the help!
 

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