Add

P

Pass-the-Reality

I have a form called frmMain that contains a subform called frmFollowup. On
frmMain I added an Unbound text box (text110) so that I can take the MAX date
from [Forms]![frmfollowup]![FollowUpDate] and add 7 to it. What do I need to
type into the default for [Forms]![frmMain]![Text110]?
 
P

Pass-the-Reality

Yes, however that does not allow me to pull the MAX amount from the field.

Karissa said:
Did you try =[Forms]![frmfollowup]![FollowUpDate]+7 ?

Pass-the-Reality said:
I have a form called frmMain that contains a subform called frmFollowup. On
frmMain I added an Unbound text box (text110) so that I can take the MAX date
from [Forms]![frmfollowup]![FollowUpDate] and add 7 to it. What do I need to
type into the default for [Forms]![frmMain]![Text110]?
 
J

Jeff Boyce

I'll assume you have a query that feeds the subform. You could look into
using the DMax() function against your query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

Frank H

To use DLookup, your frmFollowUp needs to be based upon a named table or
query (let's call it qryFlwUp).
The syntax of DLookup can be confusing. Assuming your frmFollowup subform
properties for Parent (let's call it [MainID]), and Child ([MainIDflw] field
are a matching field which is the primary key of the frmMain named
recordsource, AND that [MainID] is a datatype Number, then you could use
something like this:
(Pull up the help sheet on DLookup, I may have the syntax wrong from memory.)
=DMax("[FollowUpDate]","qryFlwUp","[MainIDflw]=" & [MainID] )

The arguments all need to be text, and the datatype of the Where affects how
you write it.

An simpler (?) and faster performing alternative would be to put a text box
named txtMax in the footer of the subform whose control source is
=Max([FollowUpDate])+7.
Then you can reference this value from a text box on the main form with
the proper syntax (easiest to get via the expression builder), that from
memory I believe would be something like =[subformname].Form![txtMax]
or something like that; it may need the =[Forms]![frmfollowup]! in front of
it.
 

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

Top