I am doing some data validation within InfoPath. One of my forms uses VBscript, not JScript, but I'm hoping this is still the best forum to post my issue.
When I use the ReportError function to produce an error, I get a compile error that says:
"Cannot have parentheses in a sub procedure".
My code is as follows:
Expand|Select|Wrap|Line Numbers
- sub msoxd__tblTestCase_TestCaseID_attr_OnValidate(eventObj)
- dim objError
- dim objStr
- if IsNumeric(eventObj.Site.nodeTypedValue) then
- if LEN(eventObj.Site.nodeTypedValue) < 3 OR LEN(eventObj.Site.nodeTypedValue) > 4 then
- eventobj.reporterror (eventobj.site, "must be 3 chars in len", false)
- msgbox("Must be 3 CHARS IN LENGTH. ")
- END IF
- else
- eventobj.reporterror (eventobj.site, "must be numeric", false)
- msgbox("Must be 3 CHARS IN LENGTH. ")
- end if
- XDocument.UI.Alert("Error message: ")
- End sub
What am I doing wrong?
Thanks!