hexagon logo

VB code for Form EventClick

I created a form that has the CMM Operators enter in their information at the beginning of a program. Since some of this information is used for filenames, I do not want to allow special characters. In the EventClick section of the Continue button, I added this code...

Dim s As String
Set s = EditBox1.Text
If InStr(s,"*") = 0 Then

MsgBox "hello"

End If


...I get an error message each time I try it. I did this for testing so I only included "*" but finalized I would like to check if the edit boxes contain "\ / : * ? " < > |" if it does, then display a message and not let them continue until it is fixed. Anyone have any ideas?
Thanks again for the help.