Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok heres the deal

I am trying to create a form in outlook, now that in its self is not to hard
but i am not a programmer and i wanted to get a bit flash, here is what i
want to do

i have four tabs in my form named (for the sake of this post):
Main - 1 - 2 - 3

Now i want a combo box on the "main" tab with 1,2 and 3 as options

Ok thats not a problem. Now here is what i want.
If the combo box is set to 1 for example i want "2" and "3" to either be
invisible or be disabled. so if the person then changed the combo box to "3"
then 1 and 2 would be invissable or disabled.

Im sure it can be done with some sort of code to check what value is in
combo box and if it matches certain criteria to either change the enabled
states of the other pages or to change that value HideSomethingSomething in
vb.

i know there is someone who can help me but please try to keep it simple as
i really dont have a clue about VB (ok i can sort of get the idea but dont
have a clue about terminology)

Any help would be great and make me look so clever at work
 
You can't hide tabs in a custom form except in design mode. The best you can
do is disable them in code, but they'll still be visible but not "clickable".
 
Thank you Eric i thought i was at a loss with this one

Ok my next question is "yep you guessed it" how to disable the forms using
the combo box

Just remeber a coding virgin here

Hehe
Anyway thanks peeps
 
Assuming you want the selected number to indicate which page you want
disabled, the code would work like this if you created a field called
MyComboBoxField and bound it to a combo box:

Sub Item_CustomPropertyChange(ByVal Name)
If Name = "MyComboBoxField" Then
Select Case Item.UserProperties("MyComboBoxField").Value
Case 1
Item.GetInspector.ModifiedFormPages("1").Enabled = False
Item.GetInspector.ModifiedFormPages("2").Enabled = True
Item.GetInspector.ModifiedFormPages("3").Enabled = True
Case 2
Item.GetInspector.ModifiedFormPages("1").Enabled = True
Item.GetInspector.ModifiedFormPages("2").Enabled = False
Item.GetInspector.ModifiedFormPages("3").Enabled = True
Case 3
Item.GetInspector.ModifiedFormPages("1").Enabled = True
Item.GetInspector.ModifiedFormPages("2").Enabled = True
Item.GetInspector.ModifiedFormPages("3").Enabled = False
End Select
End If
End Sub

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
There's an easier way -- ShowFormPage /HideFormPage, as in:

Item.GetInspector.HideFormPage "1"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
ok im back AGAIN hehe

Right i am going wrong somewhere

I have Four pages in my form labelled "Main" - "1" - "2" - "3"
On "Main" is A Combobox with a field called "Local" and then Values of 1,2,3
In the other pages is just text boxes for now.

In my script is the following thanks to your help so far

Sub Item_CustomPropertyChnage(ByVal Name)
If Name = "Local" Then
Select Case Item.UserProperties("Local").Value
Case 1
Item.GetInspector.ShowFormPage("1")
Item.GetInspector.HideFormPage("2")
Item.GetInspector.HideFormPage("3")
Case 2
Item.GetInspector.HideFormPage("1")
Item.GetInspector.ShowFormPage("2")
Item.GetInspector.HideFormPage("3")
Case 3
Item.GetInspector.HideFormPage("1")
Item.GetInspector.HideFormPage("2")
Item.GetInspector.ShowFormPage("3")
End Select
End If
End Sub

Now is there something totally wrong or should this work.

When i run the form i can see all pages and edit each one
 
If Local is a text property, you need to use string values for your Case statements -- "1" not 1.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Ok getting no where here hehe

Right tried adding quotes around the numbers after case and still no effect,
also tried the enabled=true etc eric suggested and nothing.

Here is a few more details.
The Combo box has a name of "ComboBox1"
Under Value it says in the following order:
Choose Field : Local
Type : Text
Format :Text (Grayed out)
List Type : DropDown
Property to use : Value
Possible Values : 1;2;3

There is no initial value and it is not required

If i design a form and then goto "form" and "run this form" it does run
script doesnt it???

Again i cant thank you enough for your time in this matter
 
If i design a form and then goto "form" and "run this form" it does run
script doesnt it???

Yes, all the code will run when you're testing like that.

This looks like the likely source of the problem -- a typo in the name of the event handler (Change, not Chnage)

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thank you So much, i feel silly now, the amount of times i double checked it
all hehe
i have tried it now with correct spelling and it works perfectly

Thank again for your time
i am so grateful
 
Back
Top