Dear all,
I am still learning - please can some one tell me
how can I understand that where to put the open brackets and closed
brackets and also the following
{ } [ ] ( )
Ummm... put them where they belong.
Curly brackets are not used in VBA or Access SQL.
Square brackets are used around the names of tables, fields, control
names, etc.
Parentheses are used for nesting logic.
For instance, a valid SQL query might be
SELECT [TableA].[ThisField], [TableB].[ThatField],
TableC.SomeOtherField
FROM ([TableA] INNER JOIN [TableB] ON [TableA].[Badly Named Field] =
[TableB].BetterName) INNER JOIN [TableC] ON [TableC].[Fieldname] =
[TableA].[Badly Named Field]
WHERE TableA.ThisField = [Forms]![MyFormName]![txtSomeTextbox]
Note that a fieldname (or control name, or form name) containing any
special characters - blanks in particular - must be enclosed in square
brackets, as must parameters in the query. If the name is "clean" -
BetterName or ThisField in my example - then the brackets are
optional; but they never hurt.
Perhaps you could explain what you're trying to accomplish with a
specific example; the subject of "where do I put parentheses" is just
much too broad.
John W. Vinson[MVP]