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

Unbound control on form, put data in form bound table. 1

Status
Not open for further replies.

storyboy

Programmer
Sep 16, 2004
25
US
New to this, love Access, read this site often for answers. Need help PLEASE. Have unbound control on form "Itotals" which does calculations great, shows the results great. Form is bound to table "InvoiceC" I want to have the Itotals figure displayed, put in the field IAtotals. Please help me with also where I would put any suggested code so that the record saved with all the other data on the form has the IAtotals field populated with the displayed amount. Your understanding and assistance are greatly appreciated. I thank you in advance for your help. This site has been unbelievable in helping so many.
Tom.
 
A simple way to do this, is to:

-- Add the bound control IATotals to your form. If you don't want the user to see this, set its 'Visible' property to False.
-- Add a line of code to the form's BeforeUpdate event:
Code:
IATotals = Me.Itotals

This should do it - when you save a record, the value in Itotals will be copied into IATotals, then saved with the rest of the record.

Bob Stubbs
 
I did this
I put in the bound box, then on the BeforeUpdate event property IATotals = Me![Itotals]

Hummmmm, it didn't work. Has to be a way to do this. It is a simple type of thing and logically your suggestion seems correct. Gave it a try and no cigar, still nothing in file. Any help appreciated. Thank you.
Tom
 
That has me puzzled. I checked the command syntax in my database, and both these formats work:
Code:
IATotals = Me.Itotals
(or)

IATotals = Me![Itotals]
... so I can't see what is going on either! Thoughts:

-- Are you opening your form in Add Mode or Edit Mode?
-- Is the code in the form's Before_Update event?

Bob Stubbs
 
Does this assume the form has an ok button or should this work with the stock Access columnar form? (ie, only the arrows at the bottom x of 100 records).

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top