Syntax Question...

D

Dale Lundgren

Hi All-

I'm a bit confused by some of the syntax using Access & VBA. For some
reason I can't seem to find a clear explanation in Help. Could someone
please clarify what the brackets, exclamation & period do IE:

I got this to work after much tinkering:

SELECT [Walls].[WallID], [Walls].[WallName] FROM Walls WHERE
[Walls].[ProjectID]=[Forms]![Projects].[cboProjectBrowse];

Why does "[Walls].[WallID]" need to be in brackets yet "Walls" after the
FROM statement is not?

Thank you!

Dale Lundgren
 
A

Allen Browne

In most contexts (including VBA and SQL), the square brackets are only
needed around names that contain strange characters (such as space or #) or
do not begin with a letter.

In other contexts (Control Source of a text box, in a macro, in the query
design window, ...) Access adds the square brackets automatically.

The delimiter square brackets are always permissible, but are a pain to type
all the time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top