One TextBox Not Bound to Table

R

ryguy7272

On a form, I am doing a simple calculation based on values in two Textboxes:
=[QUANTITY]*[RATE]

This is a commission (TextBox is named COMM). I enter data into several
Textboxes, and run a small macro to bind the data to a table. Everythign
updates fine, except the COMM TextBox. How do I bind this to the table so
all records update appropriately?

Thanks!
Ryan--
 
J

Jerry Whittle

Usually you don't. If you have both the Quantity and Rate data stored in the
table, you can compute the COMM as needed. That stops a lot of trouble. For
example if someone updates the Rate in the table, then the COMM can be wrong.
Another example would be storing the Date of Birth and Age fields. After a
year the data in the Age field would be wrong.

There are exceptions, such as invoices where you need to see something at a
point in time.
 
R

ryguy7272

That works! Thanks guys!!

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


KenSheridan via AccessMonster.com said:
Don't store the commission in a column the table. As Quantity and Rate are
stored values in other columns in the same row in the table then there is no
need to store the commission in a separate row as it can always be obtained
via a commuted control as you are doing, or by a computed column in a query.
If you did store it in a separate column in would be functionally dependent
on the two non-key columns Quantity and Rate, so the table would not be
correctly normalized and at risk of inconsistent data. Non-key columns
should be functionally dependent solely on the key of the table - 'The key,
the whole key and nothing but the key, so help me Codd' - which Quantity and
Rate are, but Comm would not be.

I don't see why you need to run a macro here. All you need is a form based
on the Sales (or whatever) table with two bound textboxes for Quantity and
Rate, and an unbound Comm text box with your expression as its ControlSource
property.

If you are using an unbound form for any reason, you would insert a row into
the table via code or a macro, but you'd only need to insert values into the
Quantity and Rate columns, not a Comm column for the reasons described in
para 1 above.

Ken Sheridan
Stafford, England
On a form, I am doing a simple calculation based on values in two Textboxes:
=[QUANTITY]*[RATE]

This is a commission (TextBox is named COMM). I enter data into several
Textboxes, and run a small macro to bind the data to a table. Everythign
updates fine, except the COMM TextBox. How do I bind this to the table so
all records update appropriately?

Thanks!
Ryan--
 
D

De Jager

ryguy7272 said:
On a form, I am doing a simple calculation based on values in two
Textboxes:
=[QUANTITY]*[RATE]

This is a commission (TextBox is named COMM). I enter data into several
Textboxes, and run a small macro to bind the data to a table. Everythign
updates fine, except the COMM TextBox. How do I bind this to the table so
all records update appropriately?

Thanks!
Ryan--
 

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