DON'T use non standard characters in field names (1 Viewer)

vbaInet

AWF VIP
Local time
Today, 10:22
Joined
Jan 22, 2010
Messages
26,374
I see! That used to be the pre Access 2000 way of writing subqueries. You couldn't use parentheses and I'm surprised that being a non-standard SQL syntax, it still works in newer versions of Access.

Two things to for thought:
1. Since it doesn't meet any of the standards, I wouldn't use this method because it isn't portable.
2. You cannot use square brackets if your field names contain spaces. Only absolute references work in that method. This is obviously one of the highlights of the article anyway.
 
Last edited by a moderator:

CJ_London

Super Moderator
Staff member
Local time
Today, 10:22
Joined
Feb 19, 2013
Messages
16,616
I think it is partly the 'fault' of Access which obliges when creating forms and reports etc. which will autopopulate the field name to the associated label.

New developers think 'great!, no need to do this twice, saves me time' - when in fact in the longer term it takes more time to resolved the resulting problems. They could use the caption property but hey, that means typing something in twice, so why bother...

If they have come from an Excel background, they are used to being able to put pretty much what they want in the column header which is typically not referenced by the content but it's location e.g. C1 or by counting columns. Since a datasheet view which is pretty much the first thing a new developer will see in creating a new table looks pretty much like a spreadsheet, the assumption is it is the same.

Wouldn't it be great if every time you create a field name or alias with spaces or non alphanumeric characters Access throws up a warning - it will be irritating enough for people to stop using them except where they felt it necessary.
 

Brianwarnock

Retired
Local time
Today, 10:22
Joined
Jun 2, 2003
Messages
12,701
If you do open it in design view, you must not then save the query, unless you first switch to design view and fix the SQL again.

I think the second design view should be SQL view.

Brian
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:22
Joined
Feb 19, 2013
Messages
16,616
@Brian? how does this relate to the thread?
 

Brianwarnock

Retired
Local time
Today, 10:22
Joined
Jun 2, 2003
Messages
12,701
It was in the link, an excellent explanation but , I think, with that simple error, not that it would cause confusion to an experienced user.

Brian
 

Users who are viewing this thread

Top Bottom