Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Default Value Date minus days

Discussion in 'Information Technology' started by lmv, Jul 28, 2006.

  1. lmv

    lmv
    Expand Collapse
    Guest

    I have a date box on a main form
    frmproject.datebox

    I have a subform with an unbound box
    that I want the calculated date to be the date in the datebox on the main
    form minus 90 days.

    I have tried =[datebox] -90
    But that doesn't work as all of you who know how to do this will say of
    course that won't work
    So, can someone tell me what will work?
    Thanks!!
     
  2. Loading...


  3. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    In the ControlSource of the field in the subform you can write
    =DateAdd("d",-90,Forms![MainFormName]![DateFieldName])

    --
    Good Luck
    BS"D


    "lmv" wrote:

    > I have a date box on a main form
    > frmproject.datebox
    >
    > I have a subform with an unbound box
    > that I want the calculated date to be the date in the datebox on the main
    > form minus 90 days.
    >
    > I have tried =[datebox] -90
    > But that doesn't work as all of you who know how to do this will say of
    > course that won't work
    > So, can someone tell me what will work?
    > Thanks!!
    >
    >
     
  4. KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    This might you part way there --
    =[Forms]![frmproject]![DateBox]

    BUT if you change the data in [DateBox] your subform data will not
    automatically change. You will need to add either an Event or Macro to
    refresh the box when the data in the DateBox is changed.


    "lmv" wrote:

    > I have a date box on a main form
    > frmproject.datebox
    >
    > I have a subform with an unbound box
    > that I want the calculated date to be the date in the datebox on the main
    > form minus 90 days.
    >
    > I have tried =[datebox] -90
    > But that doesn't work as all of you who know how to do this will say of
    > course that won't work
    > So, can someone tell me what will work?
    > Thanks!!
    >
    >
     
  5. lmv

    lmv
    Expand Collapse
    Guest

    Thank you for the response...

    I don't get an Error or #Name? BUT no data is displayed. Do I need to set
    something else since it is potentially a date before today's date? I have
    tried doing a date into next year but it still doesn't return a value. Format
    is set to short date.

    Thanks!
    lmv

    "Ofer Cohen" wrote:

    > In the ControlSource of the field in the subform you can write
    > =DateAdd("d",-90,Forms![MainFormName]![DateFieldName])
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "lmv" wrote:
    >
    > > I have a date box on a main form
    > > frmproject.datebox
    > >
    > > I have a subform with an unbound box
    > > that I want the calculated date to be the date in the datebox on the main
    > > form minus 90 days.
    > >
    > > I have tried =[datebox] -90
    > > But that doesn't work as all of you who know how to do this will say of
    > > course that won't work
    > > So, can someone tell me what will work?
    > > Thanks!!
    > >
    > >
     
  6. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Where did you placed this DateAdd, is it in the field default or control
    source?

    --
    Good Luck
    BS"D


    "lmv" wrote:

    > Thank you for the response...
    >
    > I don't get an Error or #Name? BUT no data is displayed. Do I need to set
    > something else since it is potentially a date before today's date? I have
    > tried doing a date into next year but it still doesn't return a value. Format
    > is set to short date.
    >
    > Thanks!
    > lmv
    >
    > "Ofer Cohen" wrote:
    >
    > > In the ControlSource of the field in the subform you can write
    > > =DateAdd("d",-90,Forms![MainFormName]![DateFieldName])
    > >
    > > --
    > > Good Luck
    > > BS"D
    > >
    > >
    > > "lmv" wrote:
    > >
    > > > I have a date box on a main form
    > > > frmproject.datebox
    > > >
    > > > I have a subform with an unbound box
    > > > that I want the calculated date to be the date in the datebox on the main
    > > > form minus 90 days.
    > > >
    > > > I have tried =[datebox] -90
    > > > But that doesn't work as all of you who know how to do this will say of
    > > > course that won't work
    > > > So, can someone tell me what will work?
    > > > Thanks!!
    > > >
    > > >
     
  7. lmv

    lmv
    Expand Collapse
    Guest

    default...

    "Ofer Cohen" wrote:

    > Where did you placed this DateAdd, is it in the field default or control
    > source?
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "lmv" wrote:
    >
    > > Thank you for the response...
    > >
    > > I don't get an Error or #Name? BUT no data is displayed. Do I need to set
    > > something else since it is potentially a date before today's date? I have
    > > tried doing a date into next year but it still doesn't return a value. Format
    > > is set to short date.
    > >
    > > Thanks!
    > > lmv
    > >
    > > "Ofer Cohen" wrote:
    > >
    > > > In the ControlSource of the field in the subform you can write
    > > > =DateAdd("d",-90,Forms![MainFormName]![DateFieldName])
    > > >
    > > > --
    > > > Good Luck
    > > > BS"D
    > > >
    > > >
    > > > "lmv" wrote:
    > > >
    > > > > I have a date box on a main form
    > > > > frmproject.datebox
    > > > >
    > > > > I have a subform with an unbound box
    > > > > that I want the calculated date to be the date in the datebox on the main
    > > > > form minus 90 days.
    > > > >
    > > > > I have tried =[datebox] -90
    > > > > But that doesn't work as all of you who know how to do this will say of
    > > > > course that won't work
    > > > > So, can someone tell me what will work?
    > > > > Thanks!!
    > > > >
    > > > >
     
  8. lmv

    lmv
    Expand Collapse
    Guest

    gotcha! it's fixed now!!
    Thanks

    "Ofer Cohen" wrote:

    > Where did you placed this DateAdd, is it in the field default or control
    > source?
    >
    > --
    > Good Luck
    > BS"D
    >
    >
    > "lmv" wrote:
    >
    > > Thank you for the response...
    > >
    > > I don't get an Error or #Name? BUT no data is displayed. Do I need to set
    > > something else since it is potentially a date before today's date? I have
    > > tried doing a date into next year but it still doesn't return a value. Format
    > > is set to short date.
    > >
    > > Thanks!
    > > lmv
    > >
    > > "Ofer Cohen" wrote:
    > >
    > > > In the ControlSource of the field in the subform you can write
    > > > =DateAdd("d",-90,Forms![MainFormName]![DateFieldName])
    > > >
    > > > --
    > > > Good Luck
    > > > BS"D
    > > >
    > > >
    > > > "lmv" wrote:
    > > >
    > > > > I have a date box on a main form
    > > > > frmproject.datebox
    > > > >
    > > > > I have a subform with an unbound box
    > > > > that I want the calculated date to be the date in the datebox on the main
    > > > > form minus 90 days.
    > > > >
    > > > > I have tried =[datebox] -90
    > > > > But that doesn't work as all of you who know how to do this will say of
    > > > > course that won't work
    > > > > So, can someone tell me what will work?
    > > > > Thanks!!
    > > > >
    > > > >
     

Share This Page