Page 1 of 1

Conditional activation of a form field

PostPosted: Tue Jan 08, 2019 9:02 am
by calstreet
I am trying to create a form for customer profile for which I need to capture if the person married or not based on which a form field with the spouse name should be activated in the form. anyone has any idea on how to achieve this.

Re: Conditional activation of a form field

PostPosted: Wed Jan 09, 2019 10:39 pm
by UnklDonald418
To do that requires coded macros. The code to hide or un-hide a form control isn't terribly complex, but it must be modified for that particular form. If you are familiar with writing OO macro code then here is the basic code to Hide and Unhide a form control. Of course it will need to be modified to work with your particular form, and you will need to find appropriate events to trigger the macros.
Code: Select all   Expand viewCollapse view
REM  *****  BASIC  *****
Sub HideControl ( oEvent as object )

  Dim oControl

  oControl = oEvent.Source.Model.Parent.getByName("Control Name Goes Here")
  oControl.setPropertyValue("EnableVisible", False)

End Sub

Sub UnhideControl ( oEvent as object )

  Dim oControl
 
oControl = oEvent.Source.Model.Parent.getByName("Control Name Goes Here")
oControl.setPropertyValue("EnableVisible", True)

End Sub

If you are not familiar with coding macros in OO the learning curve is quite steep.
Andrew Pitonyak has a book that covers OO macros, and another document devoted to Base macros.
http://www.pitonyak.org/oo.php