Solved

Access - recalc a Tabbed form Unbound textboxes

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

808 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