Use macro to set value of control on form

  • Thread starter Tom K via AccessMonster.com
  • Start date
T

Tom K via AccessMonster.com

I would like to set the value of a control on a form based on weather another
control is null or not. Im trying to use a before update conditional macro to
check if a control has a date, if it does then I want the value in another
control to be empty (null). Could I use the setvalue action? What condition
should I use to check to see if a control is not empty? Will setting the
control to null also change its value in the table?

Thanks,
Tom
 
K

Ken Snell [MVP]

Yes, SetValue action can work for this.

I'd use a Condition expression similar to this:
Len([ControlWithDateMaybe] & "") > 0
Then the SetValue would set the other control to Null.

Data in a table are changed only if a control on the form is bound to a
field in the table. Change the value of the control in this case, and the
value in the table also will change (when the form saves its data).
 
T

Tom K via AccessMonster.com

Thanks,
It works great. I also set it to be run in the other control in the after
update event to check if there was already a entry in the first control.

Thanks again

Tom
Yes, SetValue action can work for this.

I'd use a Condition expression similar to this:
Len([ControlWithDateMaybe] & "") > 0
Then the SetValue would set the other control to Null.

Data in a table are changed only if a control on the form is bound to a
field in the table. Change the value of the control in this case, and the
value in the table also will change (when the form saves its data).
I would like to set the value of a control on a form based on weather
another
[quoted text clipped - 8 lines]
Thanks,
Tom
 

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