how do i reference the current field of a form in a macro?

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

i am trying to reset an option group if criteria is met via a macro. if the
criteria is met i want the option group value to be Null, otherwise as set by
the user. any help with this would be great. i am not remotely skilled at
writting code though.

thanks!
 
Marty,

You could use a SetValue action in your macro for this. The arguments
would just be like this:
Item: [NameOfYourOptionGroup]
Expression: Null

You would have to sort out the correct expression for your Condition,
whatever you mean by "criteria is met". And you also need to decide
*when* you want this to happen, which will define the Event to which you
will assign your macro.
 
I do have the SetValue function working fine, but what i am looking for is a
way of having the "item:" default to the active/current field on the form so
i would not have to specify the item to set to Null. Otherwise i will need
to have a different macro for each of my option groups which would be
identical with the exception of the name of my option group to adjust.

More detail on my goal. if "no" is checked a form opens that can adjust
data. if the user changes their mind and does not want to save the changes
they cancel which closes the form and does the undo function. i want the
option group on the original form to return to null rather than maintaining
the "no" checkmark.

if i am trying to do this the hard way please slap some sense into me!

Thank you!

Steve Schapel said:
Marty,

You could use a SetValue action in your macro for this. The arguments
would just be like this:
Item: [NameOfYourOptionGroup]
Expression: Null

You would have to sort out the correct expression for your Condition,
whatever you mean by "criteria is met". And you also need to decide
*when* you want this to happen, which will define the Event to which you
will assign your macro.

--
Steve Schapel, Microsoft Access MVP
i am trying to reset an option group if criteria is met via a macro. if the
criteria is met i want the option group value to be Null, otherwise as set by
the user. any help with this would be great. i am not remotely skilled at
writting code though.

thanks!
 
Back
Top