date lookup in tables

  • Thread starter Thread starter gator
  • Start date Start date
G

gator

what code will look in a table called Periods and find the earliest date that
is not checked and copy the value into a field on a form that is based on
another table?
 
One way is to create a query for form (MaxDate) using Max on date field and
criteria of -1 (minus one) on check box.
Create a macro that opens MaxDate form, Set Value of the other form, and
close the MaxDate form.
 
what code will look in a table called Periods and find the earliest date that
is not checked and copy the value into a field on a form that is based on
another table?

By "Not Checked" do you mean a Check Box Yes/No datatype field?

=DMin("[DateField]","Periods","[CheckField]=0")

Change [DateField] and [CheckField] to whatever your actual field
names are.
 
gator said:
what code will look in a table called Periods and find the earliest
date that is not checked and copy the value into a field on a form
that is based on another table?

DMax("YourDate", "Periods", "YourOtherField = False")
This proabaly would be best in teh query that your form uses.
 
yes, it is a yes/no check box. Also, will this work in the default value
property?

fredg said:
what code will look in a table called Periods and find the earliest date that
is not checked and copy the value into a field on a form that is based on
another table?

By "Not Checked" do you mean a Check Box Yes/No datatype field?

=DMin("[DateField]","Periods","[CheckField]=0")

Change [DateField] and [CheckField] to whatever your actual field
names are.
 
Your solution is the best for my needs. And I did use it as default value.
It works good....thanks alot....

fredg said:
what code will look in a table called Periods and find the earliest date that
is not checked and copy the value into a field on a form that is based on
another table?

By "Not Checked" do you mean a Check Box Yes/No datatype field?

=DMin("[DateField]","Periods","[CheckField]=0")

Change [DateField] and [CheckField] to whatever your actual field
names are.
 
Back
Top