Make Fields Visible / Hide Fields with Values based on Combo Box Selection

7800
22
Jump to solution
05-20-2013 12:53 PM
kg76
by
Occasional Contributor
I have an EDITFORM with a page called DataEntry. On the DataEntry page I have a combo box (called Subtype) and three ID text fields. Based on the value selected in the combo box, I need certain combinations of those ID fields to be visible, if applicable, or hidden with a value of "N/A" if not applicable, as described below:

If Subtype = 1
Then:
IDfield1 = Visible
IDfield2 = Hidden with value "N/A"
IDfield3 = Hidden with value "N/A"

If Subtype = 2
Then:
IDfield1 = Visible
IDfield2 = Visible
IDfield3 = Hidden with value "N/A"

If Subtype = 3
Then:
IDfield1 = Hidden with value "N/A"
IDfield2 = Hidden with value "N/A"
IDfield3 = Visible

If Subtype = 4
Then:
IDfield1 = Hidden with value "N/A"
IDfield2 = Hidden with value "N/A"
IDfield3 = Hidden with value "N/A"

I was hoping to be able to do this in my geodatabase with subtype default values as "N/A" where appropriate, but alas, ArcPad does not honor default values for subtypes. I cannot have the default values at the field level because then the data recorder would be able to collect a point without changing any "N/A" values.

I don't have a whole lot of experience with VB scripting in ArcPad studio, and I'm thinking I need to use the OnLoad event for the DataEntry page and the OnSelChange event for the Subtype combo box but I'm not exactly sure how to do this.

I've read this old post that seems similar to what I'm trying to achieve http://forums.esri.com/Thread.asp?c=93&f=1180&t=124519&g=1

Any help would be greatly appreciated.

Thanks,

Kerry
Tags (3)
0 Kudos
22 Replies
ThaiTruong
Occasional Contributor II
Kerry -

Great! Glad that it works for you.  we now can mark this thread answered 🙂
0 Kudos
kg76
by
Occasional Contributor
Ok, I figured out why I was getting a scripting error through the Trimble Positions check out process...my layer names in the check out process didn't match the script.

Thank you VERY much for your help Thai!

Kerry
0 Kudos
MatthewSkewes
New Contributor
Hi,

I'm looking to do the same thing as the OP but apply it to a related table (tableform element) does anyone know how to change this code to work with the related table form instead of the editform?

ie

COMBO BOX - "Item 1" selected

If Item 1 in combo box is selected make Field related to Item 1 visible.

Unfortunately I'm pretty new to scripting, can anyone help?

Much appreciated
0 Kudos