add the dmin function

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

I add trying to use the Dmin fuction in a form. The form
is based on the table named documents.

The field with the data is called dcomdate. The field
contains the a number of begining dates for each contract.

The form is a continuos form displaying all starting dates
for the contract. I need to find and post in the form
footer the general starting date of the contract which is
the earliest date.

I can get the Dmin function to work in a query but cannot
get it to work in the form.

When I use the function wizard it ask for the
expr,domain,criteria.

I am not sure which is which. Is the "expr" the field name
with the data. Is the domain the table where the data is
stored and what is the critera?
 
Stan

Have you looked up DMin() in Access HELP for syntax clues?

Good luck

Jeff Boyce
<Access MVP>
 
The syntax for DMin is

DMin("NameOfField","NameOfTable","NameOfField=Criteria")

In your case, put in the text box in the footer:

=DMin("dcomdate","documents","ContractID=Forms!NameOfForm!NameOfTextBoxWithI
D")

This will return the minimum "dcomdate" from the table "documents" where
"ContractID" in the table equals the ID number of the current record on the
form. Change the names as appropriate for your form. Since you are using a
continuous form, you could just use the standard Min function. In your text
box in the footer put:

=Min([dcomdate])

Kelvin
 
Back
Top