Value entered on Form not in Table

J

JWeaver

I have a Text Box on a Form for a date field (To). I have it set up so that
it calculates automatically and adds 6 days to the From date. This works
fine on the Form, however, when I look at the table, the To field is blank.
How do I copy the value that gets entered in To back to the table?
 
L

Linq Adams via AccessMonster.com

You have to have the textbox bound to the field in your underlying
table/query. In Design View, select the textbox, then got Properties - Data
and click down the arrow for the Control Source Property to select the
appropriate field.
 
R

Ryan

It is best to do calculations, if possible, in queries. This way, you can
use your query as a table, and base your form on that query. Then when the
user opens a record, they see the data from the query, not from a caluation
on the form. Just take the formula that you used on the form, and go into
the query that form is based on and add a field like this.

FromDatePlusSix:YourFormula

Hope this helps.
 
J

JWeaver

When I do that my calculation goes away and now the field is blank on the Form.
 
R

Ryan

The only way to get data into a table from an unbound textbox on a form is to
write an SQL insert statement. I really would like to suggest again to
always build forms on top of queries, not tables. There are so many things
that you can do with a query that you cant do with a table, just like what
your trying to do right now. All you need to do is build a queary with all
the fields in the table your form is based on. Then add the one column I
told you about erlier. The query will hold the value and you can open the
query to show all records from that table, and it will also have your
calculated field.
 
L

Linq Adams via AccessMonster.com

When I do that my calculation goes away and now the field is blank on the >Form.

Where were you performing the calculation, as the Control Source? The
calculation should be performed in the AfterUpdate event of the From date.
 
B

Bob Larson

If the TO DATE is always 6 days after the From date then you do not need to
store it. Just display it when you need it on forms, on reports, in
queries, etc.

--

Thanks,

Bob Larson
Access MVP
Administrator, Access World Forums
Utter Access VIP

Free Access Tutorials and Resources: http://www.btabdevelopment.com
 
Top