Derived value in form doesn't appear in table

C

Cookie

Help

In a form based on a single table, I am using the dateAdd expression in the control source of field "futureDate" to derive a date from another field "todaysDate". The fields in the form are named the same as their underlying table fields in Properties/Name

Although the "futureDate" is displayed as expected on the form for all records, the "futureDate" value is not displayed in the underlying table. Consequently, when I try to query the underlying table for values including the "futureDate" this field always comes up blank

How can I make a derived date value display in both the underlying table and in queries on the derived field

Cheers

Cookie
 
A

Arvin Meyer

It is poor database design to store information which can be calculated. If
you insist on doing so, you'll need to write some VBA code to force the data
to be written. The simplest way is to use a hidden textbox bound to the
underlying field in the AfterUpdate event of each of the textboxes which
contribute to the calculation, push the data into the hidden textbox
(aircode):

Sub txtWhatever_AfterUpdate()
If Len(Me.txtOther) > 0 Then
Me.txtBoundField = Me.txtWhatever * Me.txtOther
End If
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Cookie said:
Help,

In a form based on a single table, I am using the dateAdd expression in
the control source of field "futureDate" to derive a date from another field
"todaysDate". The fields in the form are named the same as their underlying
table fields in Properties/Name.
Although the "futureDate" is displayed as expected on the form for all
records, the "futureDate" value is not displayed in the underlying table.
Consequently, when I try to query the underlying table for values including
the "futureDate" this field always comes up blank.
How can I make a derived date value display in both the underlying table
and in queries on the derived field?
 

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