Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook enabling/disabling fields

Status
Not open for further replies.

TalosBlack

Programmer
Jan 6, 2004
33
0
0
US
I am trying to use VBScript to make an OutLook form for the first time. I can't figure out what i need to do to refer to a specific field. By looking at online documentation i thought that somehting like this might work:

Sub CheckBox1_Click()
Set HMM = CheckBox1.Value
If HMM.Value=True Then
TextBox2.Enabled=True
Else
TexBox2.Enabled=False
End If
End Sub

For starters I was trying to get an attriubute from a check box if that box is checked then i would like it to enable to other fields if it isn't i don't want those fields to be available. I know that code is wrong and could be very wrong. I don't know how to refer to a field i was trying to use the name from the properties page but that doesn't seem to work. Any help would be great.

Thanks

John
 
After much guessing i got:

Sub CheckBox1_Click()
Set CheckBox1 = Item.GetInspector.ModifiedFormPages("Data").Controls("CheckBox1")
Set TextBox2 = Item.GetInspector.ModifiedFormPages("Data").Controls("TextBox2")
Set TextBox14 = Item.GetInspector.ModifiedFormPages("Data").Controls("TextBox14")

If CheckBox1=False Then
TextBox2.Enabled=False
TextBox14.Enabled=False

Else
TextBox2.Enabled=True
TextBox14.Enabled=True
End If
End Sub

This works, however, the fields begin as active which should start as inactive and after playing with the code i got errors, the same result, or the field being stuch inactive or active. If anyone can help me through that it would be great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top