Solved

Access - recalc a Tabbed form Unbound textboxes

Posted on 2013-06-09
4
609 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

12 Experts available now in Live!

Get 1:1 Help Now