Referring to Fields

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I get confused when I refer to fields and I don't quite understand when to
use quotations and when to use Exclamation marks and when to use a
parenthesis. Can anyone tell me a book or an article that explains this in
detail? I would appreciate it. Thanks
 
In what context?

If you are talking about queries:
- Refer to field like this:
MyTable.MyField

- If a name contains a space, enclose it in square brackets, e.g.:
Mytable.[My Field]

- The delimter to add around literal values depends on the datatype.
o For Text fields, use quotes, e.g.:
WHERE MyTable.City = "New York"
o For Date fields, use #, e.g.:
WHERE MyTable.DueDate = #1/1/2009#
o For Number fields, use no delimiter, e.g.:
WHERE MyTable.Amount = 100

Use the exclamation point rather than a dot when dealing with fields of a
recordset in code. For an example of such code, see:
http://allenbrowne.com/func-DAO.html#DAORecordsetExample
 

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

Back
Top