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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: How do insert values from an unbound field into a table?

Status
Not open for further replies.

NerdyOne

MIS
Oct 16, 2001
50
0
0
US
I have an unbound field with the calculation of

=IIf([Tax_Exempt]=0,[Account_Total]*0.065,0)

How do I take that value and store it in the table in the field called Tax? I need the value stored into the table so I can call upon it later in a query. The way the form is set now, the tax is calculated on the fly in the form, but in the table the field "TAX" is all zeros. Thanks for the advise, the users on this forum are ALWAYS helpful.

 
What you will need to do is add another field on your form that is bound to your table's tax field.

Using the OnCurrent Event you can then do the following -

Me.Tax.Value=Me.CalculatedTax.Value


Steve
 
If you don't want to add a bound field, you could execute an SQL update. You would need to know the unique ID of the record that you want to update.

dim sSQL as String

sSQL = "UPDATE [YourTableName] SET [Tax]=" & Me.Tax.Value & " WHERE [YourIDNumber]=" & [IDNumber from record]

CurrentDB.Execute sSQL
 
Hi,
I'm trying to do the same thing for my calculated text boxes on my form (updating the table field with the value of the calcuated text box).

But I don't see an OnCurrent event anywhere to put the following statement:

Me.[NameofFieldinTable].Value=Me.[NameofTextBox].Value

(I've got about 20 calculated fields to do this with)

Thank you so much for your help! : )
Tiffany
 
When you are editing the form, you have to click on the properties of the FORM, not any control boxes. You do this by right clicking the little square in the upper left hand side of the edit window. From there, under Events, you'll see On Current.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top