Form wont update to table

J

Jwell

I created a database by designing my tables and then
using the form wizard to produce my forms. However when
I enter info. into the form, although it works great in
the form, it will not post the information to the
corresponding table. Example below.
Form:
Amount Owed: =[Feet]*.15
Change: =[Amount Paid]-[Amount Owed]
These calculate fine and the form works great except that
the info does not show up on the form.
The fields are set to Currency, and not indexed. I
entered the expressions above in the form design screen
by selecting the box, right clicking, selecting
properties and entering the info as listed above in the
control source field. Please let me know what I am doing
wrong!!! THANK YOU!!!
 
A

Ashby

Based on what you have written, you have created two
unbound fields. An unbound field is a field that is not
tied to a field in the table. By changing the record
source to an expression you created an unbound field.

My suggestion would be to change the record source of both
fields to the field name in the table and then write a
small piece of code in the afterupdate event of the form.

[Amount Owed] = [Feet]*.15
Change =[Amount Paid]-[Amount Owed]

Hope this helps.
 
F

Fredg

You are not using Access properly if you do this.
As long as you have the [Feet] field storing the number of feet (sold?),
that (and the cost) is all you ever need to compute the AmountOwed and the
Change.
There is no reason to save it. When you do need that computation, in a form,
query, or report, compute it, just as you already have.
Same thing with 'Change'.
That should not be a field in your table.
When you must compute the change then,
in an UNBOUND control:
= [Amount Paid] - ([Feet]*.15)

The only field you need, of all of these, is [Feet].
Note: You should also have a field (in a different table) that stores the
..15 cost, in which case you would use, to determine the change:
=[Amount Paid] - ([Feet] * DLookUp("[Cost]","CostTableName"))
This way, all you need do when the cost changes, is update one field in the
table, not all the code.
 

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