- Fieldname refers to the field against which the function will be applied.
- RecordSource refers to a table or query from which the records will be pulled.
- Criteria Expression is basically an SQL Where clause without the WHERE keyword. (optional)
- Numeric values do not need delimiters (DLookup example below).
- Date values need the # delimiter around them (DMax example below).
- Strings need either the apostrophe (') or quote (") delimiters (DSum example below).
Because the entire Criteria Expression must be string delimited, the expression evaluator will get confused when using the quote to delimit a sting value, so you have to use two quote marks ("") in place of one ("). I'll discuss this in a later post.
Variables in Criteria Expressions
So far, I've just used hard-coded values in the Criteria Expression. That's not the most useful application of domain functions. Domain functions become most useful when you use a variable for the value in the Criteria Expression.