Yes, you can do as you state. Place the release number in the table along
with the date that it goes into effect. You can even place them in the table
ahead of time. In the Load event of the form you can assign the Caption
property of the label or you could create a textbox that looks like a label
and make it a calculated control. If you go the textbox route, you may want
to set the Locked and Enabled properties of the textbox to Yes.
The formula for the lookup would then be:
DLookup("[ReleaseNumberField]", "[TableName]", "[DateField] =
DMax(""[DateField]"", ""[TableName]"", ""[DateField]<=Date()"")")
Note the double quotes, they are because you need to pass quotes to the
embedded function without making the outer function think that it has
reached the end of its string.
Another option would be to use a query instead of the table. If you sort the
query descending on the date field, DLookup will stop at the first record it
finds that meets the criteria. You could then use the following statement:
DLookup("[ReleaseNumberField]", "[QueryName]", "[DateField]<=Date()")
--
Wayne Morgan
MS Access MVP
<SH********@aol.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
We have an Access 2K application that uses multiple forms. We
currently hardcode the release number in a label on each form but this
gets tedious to do each time there's a new release. I thought it would
be easy to put the new release number in one spot (a table) and have
each form reference that table/release number in a text box that I
would add to each form but, apparently, it's not as simple as I
expected it to be. Would appreciate anyone who could shed further
light on how to do this.
Thank you, Sheldon Potolsky