?
Solved

Access - recalc a Tabbed form Unbound textboxes

Posted on 2013-06-09
4
Medium Priority
?
625 Views
Last Modified: 2013-06-09
Hello again.

I have a multi tabbed form.  One of those tabs has a form where I have several unbound textboxes.  It also has an unbound textbox that adds info from all of the unbound textboxes on that form (single form).

Now then, when the user clicks a command button (ON A DIFFERENT TAB's FORM)  this tab's form gets populated with info using a DAO.recordset.  All of the boxes are getting their info correct but the unbound textbox where I have my subtotal doesn't automatically calculate.

On this form with the unbound boxes, I have a Private sub to add all my unbound textboxes.  To execute that sub each unbound box's After_Update event calls that private sub.  However, how can I get it to recalc when that form is being updated from a command click on another form?
0
Comment
Question by:wlwebb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Dale Fye
ID: 39233472
Set the control source of the textbox that you are using to do your summation to something like:

ControlSouce: = nz([Text0],0)+nz([Text2],0)

You may need to set the format of the various unbound text fields to get this to work right.  Sometimes VBA will return a string from the NZ function, even when you have identified the return value.
0
 

Author Comment

by:wlwebb
ID: 39233474
I was trying to keep from using that form's control source.  That is why I did it in a private sub.  Any way around that?
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 39233567
Use the control source for the unbound textbox (on the subform) that contains the sums, not the Forms control source.

That way, it will recalculate as soon as either of the other controls is updated, even if you update those unbound controls via VBA.
0
 

Author Closing Comment

by:wlwebb
ID: 39233795
Thank you
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question