Hide pages on MultiPage control based on Option selected

J

Jim Fazakas

I am putting together a customer message form and have a MultiPage
control with pages "Page1", "Page2", and "Page3". I also have an
OptionButton control within a frame called "frmSelectRecordType". I
want to hide pages "Page2" and "Page3" if the value of the "Select
Record Type" field is "Outage". If the value is "Change", then I want
to hide pages "Page1" and "Page3".

The script below that I am using runs without error, but doesn't give
me the results I am looking for. I not that familiar with VBscript.
Any ideas on what might be wrong with the script is appreciated.
Thanks!


Function Item_Open()

Dim objPageTwo
Dim objOutageTab
Dim objChangeTab
Dim objMemoTab
Dim objSelectRecordType

Set objPageTwo = Item.GetInspector.ModifiedFormPages("P.2").Controls
Set objOutageTab = objPageTwo("Multipage1").Pages("Page1")
Set objChangeTab = objPageTwo("Multipage1").Pages("Page2")
Set objMemoTab = objPageTwo("Multipage1").Pages("Page3")
Set objSelectRecordType = objPageTwo("frmSelectRecordType")

If UserProperties.item("Select Record Type").value = "Outage" THEN
objOutageTab.visible = True
objChangeTab.visible = False
objMemoTab.visible = False

ElseIf UserProperties.item("Select Record Type").value = "Change"
THEN
objOutageTab.visible = False
objChangeTab.visible = True
objMemoTab.visible = False

ElseIf UserProperties.item("Select Record Type").value = "Memo" THEN
objOutageTab.visible = False
objChangeTab.visible = False
objMemoTab.visible = True

Else
objOutageTab.visible = True
objChangeTab.visible = True
objMemoTab.visible = True

End If

End Function
 

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