Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bound control but updated via calculation?

Status
Not open for further replies.

SimonPGreen

IS-IT--Management
Mar 8, 2004
116
GB
Hi,

I have a requirement to have a control on a form that meets the following criteria:

1. Is bound to a table field
2. Has its value automatically calculated based on the value in a related table (Could use dlookup)
3. Can have a manual value overwrite the calculated value

Example:

Net Value = £1000
Discount = £100 (calulation based on discount percentage stored on supplier details)
New discount = £150 (as negotiated on a one off basis)overtyped over the £100 value

I appreciate that I shouldn't store calculated values in the table but have compelling reason to do so in this instance.

Not sure how I bind, display and write different data?

Hope this makes sense :)

Appreciate any help.

Simon


 
Maybe you can put the calculation for the bound control in an after_update_event or on a button_click.

Me.BoundControl = Me.Control1 * DlookUp("","")

or something like that

Pampers [afro]
Keeping it simple can be complicated
 
You can use code to update a bound textbox with the default value, or set a default value for the textbox:

[tt]=DLookUp("Field1","Table1")[/tt]

Setting a default value will only work for new records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top