Check boxes on my custom form

F

focus26

Hi,

I am creating a custom form for some work requests (message form). On the
form I have a question which requires a yes/no answer and have used check
boxes for this, the answer to this question makes other check boxes on the
form grey out. So if answered yes 14 check boxes grey out (and are
unselectable), if answered no 4 boxes grey out.

This all seems to work fine, expect that I can't get the tick to stay in the
yes/no check box, or the greyed out text boxes to stay that why when the mail
is sent.

I know you can bind the check boxes (I have done this with the 18 other
check boxes and the infomation passes across). But if I bind the Yes and No
check boxes then the greying out no longer works.

Any suggestions on how to get both working at the same time would be
gratefully recieved.

Thanks.
 
S

Sue Mosher [MVP-Outlook]

Any changes you make to the form UI, such as disabling a control, are not saved with the item. Outlook only saves the data in the item properties. Therefore, if you want the same UI changes to appear when the item is displayed again, you need (a) a way to save information on what UI changes are needed and (b) code in the Item_Open event handler to make those changes happen. You already have code to do (b). To handle (a), add one or more properties to the Outlook item to store the state. The easiest solution is to use Yes/No properties for the key check boxes and use the CustomPropertyChange event to effect the UI changes when the user checks the boxes. See http://www.outlookcode.com/article.aspx?ID=38
 
F

focus26

Hi Sue,

Thanks for the advice. I have done this and now when I check the Yes box and
one of the other this data doesn't get send across (before I would lose the
check in the yes box).

I still can't seem to get the check boxes to show correctly though. As
stated before when I check the Yes check box, 14 of 18 other check boxes are
visible (4 non visible), but when this form is sent all are visible again.

This is the code I am using against the other check boxes:-

Set objControl = objPage.Controls("CheckBox1")
objControl.Value = False
objControl.Enabled = False

But the enabled = False only works until you send the form. Any ideas?

Thanks
 
S

Sue Mosher [MVP-Outlook]

DId you put code in the Item_Open event as I suggested? DId you publish the form to the Organizational FOrms library with the "send form definition with item" box unchecked? Both are required to do what you want.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 

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