Solved

Access - recalc a Tabbed form Unbound textboxes

Posted on 2013-06-09
4
612 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
  • 2
  • 2
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
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 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now