Validation For File Name Spaces

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hope everyone had a nice Holiday. I have an InsertFile command that works
well and inserts the user selected file into a field called FileName.
However, I want to make sure that the file name does not have any spaces in
the name. If it does, I would like to disallow the entry and send a message
to the user that filenames with spaces are not allowed. Any ideas on how I
would go about this? Thanks.
 
How about?

if instr(1, FileName," " ) > 0 then
msgbox FileName & " has at least one space"
end if
 
Or, you could just replace the spaces with an underscore using the Replace()
function.

HTH
Dale
 
Back
Top