UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Updating Textbox Value To The Existing Row In The Table, Access 2010    
 
   
rosdi
post Apr 16 2018, 10:35 AM
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.
Go to the top of the page
 
tina t
post Apr 16 2018, 01:30 PM
Post#2



Posts: 5,480
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"
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th August 2018 - 06:11 PM