My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 5 Joined: 19-February 18 ![]() | I'm not sure it is correct question or not. Hope you can understand. In the Setting table, there is a TaxRate field which is set as [TempVars]![tmpTaxRate]. The TempVars will load in Macro setting during the database started/open. Another table is TaxInvoice table which one of the fields inside is TaxRate. The textbox (txtTaxRate) in TaxInvoice form is set the default value "=[TempVars]![tmpTaxRate]". The TaxRate (TempVar) value will appear if I don't set the Control Source to TaxRate field in TaxInvoice table. The value will become "0" if I set the Control Source. It seems that the textbox is referring to the field, not updating the default value/tempvar value to the field. How to update that to the existing row? Thanks. |
![]() Post#2 | |
Posts: 5,340 Joined: 11-November 10 From: SoCal, USA ![]() | QUOTE The textbox (txtTaxRate) in TaxInvoice form is set the default value "=[TempVars]![tmpTaxRate]". The TaxRate (TempVar) value will appear if I don't set the Control Source to TaxRate field in TaxInvoice table. The value will become "0" if I set the Control Source. It seems that the textbox is referring to the field, not updating the default value/tempvar value to the field. well, i'm not really sure what you're getting at here, and from the lack of other responses, it seems nobody else is, either. i'm wondering, though, if your expectations are in line with the way these properties work: in a textbox control in a form, the DefaultValue property of the control only applies to new records, and it is only set as the value of the control if you actually enter data in any field - you have to "dirty" the record. in a textbox control in a form, setting the ControlSource property of the control to the name of a field binds the control to that field in the form's RecordSource; it's then a bound control and whatever value you put in the control will be saved into the underlying field. you can also set the ControlSource property to an expression such as =<an expression, or a string, or a number> the control is then considered unbound, because it is not bound to a field in the form's RecordSource. the control will display whatever value you set in the ControlSource property, but it will not store that value in any field in any table. can you explain more clearly what you're actually doing, and what results you expect to get? hth tina -------------------- "the wheel never stops turning" |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 23rd April 2018 - 06:21 AM |