Ask Your Question

Set a form boolean field to TRUE

asked 2017-07-19 16:30:29 +0200

David_Ssc gravatar image

I have a Base form field "ValidDL" referring to a boolean field in my table. How do I set that value with a macro?

    Me.getByName("ValidDL").text = TRUE

"Me" is the form object. What should I replace "text" with? Thanks, David

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-07-19 17:23:44 +0200

librebel gravatar image

Hello @David_Ssc,

If your field "ValidDL" is actually a Checkbox control in your form, then you could write:

Me.getByName("ValidDL").State = 1
edit flag offensive delete link more


Never thought to use an integer value to set a boolean field! Thank you. Apparently, you do not need to .commit() the change after it is set in this way.

David_Ssc gravatar imageDavid_Ssc ( 2017-07-19 17:51:55 +0200 )edit

well, Checkboxes can have an intermediate state, hence the need for a short instead of a boolean. I think it still needs commiting, since only the state of the control was changed, not the bound field.

librebel gravatar imagelibrebel ( 2017-07-19 17:59:07 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-07-19 16:30:29 +0200

Seen: 302 times

Last updated: Jul 19 '17