Re: Problems with date-expression in Acces 97

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Nikos Yannacopoulos (nyannacoREMOVETHISBIT_at_in.gr)
Date: 09/15/04

  • Next message: Nikos Yannacopoulos: "Re: Double data input"
    Date: Wed, 15 Sep 2004 11:01:41 +0300
    
    

    Jeroen,

    To begin with, ask yourself if you really need to store the number of weeks.
    If it can be calculated on the basis of other stored data (in this case, the
    two dates) then you don't need to store it, you just calculate it everytime
    you need it (in queries, forms, reports etc).

    If you still need to store it:
    Under your current design the number of weeks is not stored because its
    control on the form is not bound to the table field; I guess you are using
    its ControlSoure property for the calculation expression.
    The ControlSource property of the control should be set to the name of the
    table field you wish to store it in. The expression that calculates the
    number of weeks should be used in the Expression argument of a SetValue
    action in a query fired by the On Change event both date controls on your
    form. The idea is that the number of weeks control on the form is bound to
    the table field (so as to store the information), displays the stored
    information for existing records, and whenever you create a new record or
    change one of the dates in an existing one the macro fires and calculates
    the new value in the control (which is also saved in the table, the control
    being bound).

    HTH,
    Nikos

    "Jeroen" <anonymous@discussions.microsoft.com> wrote in message
    news:122401c49af5$6ccac6b0$a601280a@phx.gbl...
    > Does anyone have a solution for this (probably newbie)
    > problem:
    >
    > I made a form to fill a table. In the form i've put a
    > date-expression so to automatic calculate the number of
    > weeks (datediff). In the form it works fine: in the
    > fieldbox is shows the exact number of weeks, however when
    > I open the underlaying table, the corresponding field is
    > empty. So in other words the data that is calculate in
    > the form-expression isn't stored in the corresponding
    > table.
    >
    >


  • Next message: Nikos Yannacopoulos: "Re: Double data input"

    Relevant Pages

    • Re: running sum from a subform
      ... The purpose of a table is to store the essential information you require. ... subform onto the main form ... The usual way of handling this is to insert a control in the subform ... bound control's value to your calculation: ...
      (microsoft.public.access.forms)
    • RE: running sum from a subform
      ... The purpose of a table is to store the essential information you require. ... subform onto the main form ... The usual way of handling this is to insert a control in the subform footer, ... bound control's value to your calculation: ...
      (microsoft.public.access.forms)
    • Re: Getting an UnBound control value into a Table field??????
      ... I will need to store the number of parts in the test and the amount of time ... As Jeff suggests, put the calculation into a query, and use the query ... If I bind my control to the Table, I can't have the control calculate the ...
      (microsoft.public.access.forms)
    • Re: help with easy form code
      ... calculated control to display the results. ... You should not store this ... calculation in a table, it should be recalculated whenever you need it. ... the report and use running sums within the groups if you want a total sum ...
      (microsoft.public.access.formscoding)
    • defining non-specific field names in a table
      ... transaction and the peripherals are different from store to store. ... control where i use dlookup with the criteria that > the previous id ... Dim holdPlace As Integer ... For Each currControl In Me.Controls ...
      (microsoft.public.access.tablesdbdesign)