Hi
I've written a little program which allows users to generate letters using forms, etc. I'm also attempting to standardise the way users save, which works to a degree.....
The problem I have is when the users are entering the contact details and description for the letter if they enter any of the following invald characters: forward slash (/), backslash (\), greater than sign (>), less than sign (<), asterisk (*), question mark (?), quotation mark (", pipe symbol (|), colon ), or semicolon (.
the debug 5152 appears and all variables are lost and they crash out.
The saving aspect of my code reads:
ActiveDocument.SaveAs FileName:=("p:\" & GetUserName & "\letters\Let - " & TxtClient & " - " & txtCompany & " - " & Txttoname & " - " & txtHeading1 & " - " & Format(Now(), "dd-mm-yyyy" & " " & Format(Now(), "h m s" & ".doc"
which saves the file in the users home directory and sub folder called letters and then enters various variables, as well as the creation date and time at the end. So a pathname might look like:
p:\john smith\letters\let - Tek Tips - Mr Smith - What a great site - 24-07-2002 10:30.doc
How can I check that no invalid characters have been entered and that the form/module completes? Should the checking for these characters be done when the users clicks on OK or as the user is entering the characters in each text box?
Any help is great appreciated.
Tolan
I've written a little program which allows users to generate letters using forms, etc. I'm also attempting to standardise the way users save, which works to a degree.....
The problem I have is when the users are entering the contact details and description for the letter if they enter any of the following invald characters: forward slash (/), backslash (\), greater than sign (>), less than sign (<), asterisk (*), question mark (?), quotation mark (", pipe symbol (|), colon ), or semicolon (.
the debug 5152 appears and all variables are lost and they crash out.
The saving aspect of my code reads:
ActiveDocument.SaveAs FileName:=("p:\" & GetUserName & "\letters\Let - " & TxtClient & " - " & txtCompany & " - " & Txttoname & " - " & txtHeading1 & " - " & Format(Now(), "dd-mm-yyyy" & " " & Format(Now(), "h m s" & ".doc"
which saves the file in the users home directory and sub folder called letters and then enters various variables, as well as the creation date and time at the end. So a pathname might look like:
p:\john smith\letters\let - Tek Tips - Mr Smith - What a great site - 24-07-2002 10:30.doc
How can I check that no invalid characters have been entered and that the form/module completes? Should the checking for these characters be done when the users clicks on OK or as the user is entering the characters in each text box?
Any help is great appreciated.
Tolan