Function vldUsrname(tcValue, tlPreStatus, roMessage) Local llRetVal llRetVal=.T. *-- NOTE: You will need to fill in this method *-- if you want validation on field USRNAME of table USER * * It must be a Present IF llRetVal AND (ISNULL(tcValue) OR EMPTY(tcValue)) llRetVal = .F. IF VARTYPE(roMessage) = "O" roMessage.AddMessage("UserEmptyUsrName", THIS.NAME ) ENDIF ENDIF * It must be character IF llRetVal AND (VARTYPE(tcValue) # 'C') llRetVal = .F. IF VARTYPE(roMessage) = "O" roMessage.AddMessage("UserNonCharacterUsrName", THIS.NAME ) ENDIF ENDIF * It must be no more than 18 characters IF llRetVal AND (ALLTRIM(LEN(tcValue)) > 18) llRetVal = .F. IF VARTYPE(roMessage) = "O" roMessage.AddMessage("UserTooLongUsrName", THIS.NAME ) ENDIF ENDIF Return llRetVal EndFuncWhen ComCodeBook reaches the line roMessage.AddMessage("UserEmptyUsrName", THIS.NAME ) it generates an error:
Error in RMCONTROLLER::AUTOMATICSAVE() Line 428 Error Number: 1429 1429 OLE IDispatch exception code 1429 from User: ~Error: 1429 Line: 405 User::Validate() OLE IDispatch exception code 302 from Visual FoxPro for Windows: Data type mismatch..... ~Error: 1429 Line: 405 User::Validate() OLE IDispatch exception code 302 from Visual FoxPro for Windows: Data type mismatch... User User 0 1429I added the record to the MsgSvc table and placed the 'UserEmptyUsrName' as the key and put the return text in the cOriginal field. Since this is all that the COMCodeBook document told me to do, I am stumped as to why the validation is erroring out. Any help would be appreciated.