ラジオボタンで「支払」を選択した場合のみ支払日のカードを表示させるように設定したい。
このような場合は「支払日」カードの詳細設定プロパティのVisibleでコントロールする。
初期値は
Visible = true
設定した値は以下のような感じ。
Visible = Switch(
Radio1.Selected.Value,
"支払", true,
"請求", false
)
ラジオボタンで選択した値が"支払"の場合はVisible = true
"請求"の場合はVisible = falseになる。
IF文でも出来そうだけど個人的にはSwitchの方が好み。
ちなみにIF文の場合はこんな感じで動いた。
If(Radio1.Selected.Value="支払",true,false)
この場合は2択だったので"支払"じゃない場合はElseでFalseに出来るけど、
複数選択肢がある場合は、IFを入れ子にする必要があるのかなと。
興味がある方はやってみてください。
あ、肝心の動作結果貼り忘れた。
フォームの内容をリストに登録する際、ユーザーの入力項目によって
必須項目が可変になる場合に、このやり方を使うと不要な項目をユーザーに意識させる事がないので便利。
以上