View Single Post
  #1  
Old June 27th 07, 03:14 PM posted to microsoft.public.outlook.program_forms
Scott07
external usenet poster
 
Posts: 28
Default Setting a Category

Hi,

I'm having trouble adding to my code to set a Category by clicking a
Checkbox. I'm getting an error on line 8. I think something is wrong with
the If-Then clauses, but I researched a bit and it seems right (although
probably not). If I remove the SummerEvening and SummerSaturday lines,
everything works fine. Here's the code:

Function Item_Write()
Set myinspector = Item.GetInspector
Set test = myInspector.ModifiedFormPages("Availability")
Set SummerWeekday = test.Controls("SummerWeekday")
Set SummerEvening = test.Controls("SummerEvening")
Set SummerSaturday = test.Controls("SummerSaturday")

If SummerWeekday.Value = True & Then
Item.Categories = Item.Categories & ",SummerWeekday"
ElseIf SummerEvening.Value = True & Then
Item.Categories = Item.Categories & ",SummerEvening"
Else SummerSaturday.Value = True & Then
Item.Categories = Item.Categories & ",SummerSaturday"

End If
End Function

Thanks.
Ads