Date's in a database

M

MJFrog

I have two fields on a form that are connected.

When a work recieved date is added to the first one, the second field is
automatically given a value that is exactly 21 days later. The problem I'm
having is that the automatically generated values are not showing in the main
table.

If i re-access the same record by searching (Ctrl+F) in the form the date is
still there, but no matter what I do the data field in the table just shows
up blank. This only seems to have happened from when the automatically
generated dates move into december (ie. 02/12/2005).

Can anyone help with this? If you need any extra info to help me just post
here and I'll get the info.
 
R

Rick Brandt

MJFrog said:
I have two fields on a form that are connected.

When a work recieved date is added to the first one, the second field
is automatically given a value that is exactly 21 days later. The
problem I'm having is that the automatically generated values are not
showing in the main table.

By what mechanism are the values automatically generated? If it is by using an
expression in the ControlSource then that is the reason. A form control saves
data to the underlying table by having a field name as its ControlSource. It
effectively tells the control "save your value here". If the ControlSource is
an expression then there is no place to save the value.

Now for the bigger question. Is this auto-generated value simply a default
value that you sometimes need to change, or is is ALWAYS the other date plus 21
days. If the latter then there is no reason to save it in the first place and
proper database theory dictates that you should not save it in the table. You
should just calculate it on the fly in queries, forms, and reports.
If i re-access the same record by searching (Ctrl+F) in the form the
date is still there, but no matter what I do the data field in the
table just shows up blank. This only seems to have happened from when
the automatically generated dates move into december (ie. 02/12/2005).

This part makes no sense to me. Perhaps after you answer my first question it
will.
 
M

MJFrog

Rick Brandt said:
By what mechanism are the values automatically generated? If it is by using an
expression in the ControlSource then that is the reason. A form control saves
data to the underlying table by having a field name as its ControlSource. It
effectively tells the control "save your value here". If the ControlSource is
an expression then there is no place to save the value.

The control source is as follows:
=[WorkRecvdDate]+21
But I don't understand why this would suddenly stop working as it has always
worked up until now...
Now for the bigger question. Is this auto-generated value simply a default
value that you sometimes need to change, or is it ALWAYS the other date plus 21
days. If the latter then there is no reason to save it in the first place and
proper database theory dictates that you should not save it in the table. You
should just calculate it on the fly in queries, forms, and reports.

I use the generated date in queries which then are used to generate reports.
Therefore I need it stored so that I can search the table when working out
statistics
This part makes no sense to me. Perhaps after you answer my first question it
will.

By this I meant that If i go into the visual form view (where data is put
in), go into the field that holds the table's key field and press Ctrl+F, it
gives me the standard office find tool which I use to find the records
quickly in this view.
 
R

Rick Brandt

MJFrog said:
Rick Brandt said:
By what mechanism are the values automatically generated? If it is
by using an expression in the ControlSource then that is the
reason. A form control saves data to the underlying table by
having a field name as its ControlSource. It effectively tells the
control "save your value here". If the ControlSource is an
expression then there is no place to save the value.

The control source is as follows:
=[WorkRecvdDate]+21
But I don't understand why this would suddenly stop working as it has
always worked up until now...

Sorry, but there is no way that a ControlSource like that EVER saved a value to
the underlying table.
Unless there is code somwhere that was copying that value into the actual field
or another hidden control that had the field name as its ControlSource then what
you have there would have no affect at all on the table.

As stated though, there is no reason to save a value that is derived from
another value that you are already saving.
 
M

MJFrog

Rick Brandt said:
MJFrog said:
Rick Brandt said:
MJFrog wrote:
I have two fields on a form that are connected.

When a work recieved date is added to the first one, the second
field is automatically given a value that is exactly 21 days
later. The problem I'm having is that the automatically generated
values are not showing in the main table.

By what mechanism are the values automatically generated? If it is
by using an expression in the ControlSource then that is the
reason. A form control saves data to the underlying table by
having a field name as its ControlSource. It effectively tells the
control "save your value here". If the ControlSource is an
expression then there is no place to save the value.

The control source is as follows:
=[WorkRecvdDate]+21
But I don't understand why this would suddenly stop working as it has
always worked up until now...

Sorry, but there is no way that a ControlSource like that EVER saved a value to
the underlying table.
Unless there is code somwhere that was copying that value into the actual field
or another hidden control that had the field name as its ControlSource then what
you have there would have no affect at all on the table.

As stated though, there is no reason to save a value that is derived from
another value that you are already saving.

Having thought about it I'll just change the way my queries and reports are
handled. Sorry for sounding stupid but you have helped to answer my question.
:-D
 
Top