Un this case, we were looking at the first parameter
(field identifier) for a domain function. There is no DAO
or Access recordset or collection.
Domain Functions take SQL strings as parameters.
So the presumption is that JET SQL syntax should be used.
Which is
databasename.tablename.fieldname
or
[databasename].[tablename].[fieldname]
The Jet SQL expression evaluator will also accept
expressions of the form:
tablename!fieldname
or
(tablename!fieldname)
or
(1*(0+tablename!fieldname)) as n
as
v = dcount("(1*(0+tablename!fieldname)) as n","tablename")
Using an expression instead of a fieldname in your SQL
prevents some optimisations, but is generally irrelevant.
However, even more than in VB, it wouldn't normally be
considered good practice.
(david)
"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
A Table, Recordset has a collection of fields as a property. Each item
in the fields collection is accessible by index, name or ordinal.
The use of the bang conceals this, by short-circuiting
recordset.fields(index).value
to
recordset!index
I cannot think that the latter is "the syntactically correct way". I
have not used a bang for many years. I think this makes my code clearer
and less prone to error.
IMO the best way (a la Dimitri Furman) to deal with any property of a
field is to declare and intialize a reference to the specific field:
Dim f as DAO/ADO.Field
.
.
.
Set f = r.Fields("Watermelon")
.
.
.
Debug.Print f.Value
Previous tests in CDMA have shown that for repeated reference this is
the fastest way.