Question Special character issue (1 Viewer)

llkhoutx

Registered User.
Local time
Today, 17:43
Joined
Feb 26, 2001
Messages
4,018
I'm letting users specify the name for a table to be created. Can those names be easily parsed to eliminate special charactes, e.g. "yyy&&" is convertred to "yyy", or does the name have to be parsed character by character. I tried to catch the error fired, but none fired and the table was created with Access 2007?:(
 

jdraw

Super Moderator
Staff member
Local time
Today, 18:43
Joined
Jan 23, 2006
Messages
15,379
Why?
Where/how did you try to catch the error or invalid characters?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:43
Joined
Feb 19, 2013
Messages
16,612
Best to capture in the control validation rule

or in the after update event use replace to remove them

Incidentally for table names, best not to allow spaces so definately one to remove

replace(TableName," ","")
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 23:43
Joined
Sep 12, 2006
Messages
15,656
backup

why would the users need to specify a name for a created table?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:43
Joined
Feb 19, 2013
Messages
16,612
Hi gemma,

I was going by this

I'm letting users specify the name for a table to be created

Generally not good practice, I know, but there are times when I have had to provide the facility to build a Create Table query
 

Users who are viewing this thread

Top Bottom