change value of boolean in onafterchange event handler

S

Scott

Hello,

I am using vbscript, and I have a date picker named RequestDate. I would
like to set the values of 2 check boxes (named "cancel_exp" & "pls_expedite")
back to false every time the date picker is changed. I already have an
OnAfterChange event handler on my form. Can I add some code to this section
(see below)? If so please provide. Thanks.



Sub msoxd_my_RequestDate_OnAfterChange(eventObj)

' Write code here to restore the global state.

If eventObj.IsUndoRedo Then
' An undo or redo operation has occurred and the DOM is read-only.
Exit Sub
End If

' A field change has occurred and the DOM is writable. Write code here to
respond to the changes.
CalculateDateDifference

End Sub
 
H

Hilary Stoupa

Hi:

Dim firstBox
Dim secondBox

Set firstBox = XDocument.DOM.selectSingleNode("/my:myFields/my:field8")
Set secondBox = XDocument.DOM.selectSingleNode("/my:myFields/my:field9")

firstBox.text = "false"
secondBox.text = "false"

This would go between End If and End Sub. The XPath in the selectSingleNode
method will need to change to match your schema.
 

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