add the dmin function

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?
 
J

Jeff Boyce

Stan

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

Good luck

Jeff Boyce
<Access MVP>
 
K

Kelvin

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
 

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

Similar Threads

DMIN error 6
DMax and DMin Code Help Needed 3
DMin Function 2
earliest date 1
DMAX and DMIN 1
DMin external database 3
clickable search results? OR show record of record 6
Data Entry Form. 3

Top