Limiting Categories?

L

leah977

I've created an event form for our departmental attendance calendar in
Outlook. On this form I have the following fields:

Subject = dropdown list of departmental employees
Categories = value field with checkboxes for possible leave type
(annual, sick, personal, etc)
Start & End
Hours = Custom number field required for total number of hours leave
taken

Here's where I have a problem. I want to limit the categories. What I
mean is, I only want the user to be able to choose one category, not
multiple. So when a second category is chosen the first category is
unchecked, or at the very least a warning pops up letting them know
they can only select one. I know this can be achieved with radio
buttons, but when I list "possible values" in properties it
automatically lists them with checkboxes. Did that make sense? Can
anyone help me?
 
S

Sue Mosher [MVP]

Categories is a keyword-type data field and, therefore, by design accepts multiple values. To enforce selection of just a single category, you would need to use code behind the form (probably in the Item_Write event handler) to check the number of categories chosen and warn the user if they have more than one.

Another approach that might be easier to implement (but that I haven't tested) would be to bind the option buttons to a text field instead of Categories, then use a formula to set the value of the Categories propertie to that one text field.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
L

leah977

Thanks for your reply :) What I ended up doing was actually creating
the radio buttons I mentioned before and grouped them in a frame. In
the properties of each selection I designated it as "Categories" and
assigned the shorthand code (i.e. Annual Leave = AL) in the value
field. All I had to do was change the caption. Once I tooled around
with it a bit it seemed to work quite well.

I did, however, take a bit of your advice on the formula you mentioned.
I wanted the category to show up in the calendar view so I made
Location (which is usually shown in parenthesis next to the subject)
equal to Categories. It worked beautifully!
 
S

Sue Mosher [MVP]

All good solutions! Sounds like you're finding that Outlook can be fun if you can stay flexible in your approach.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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