Solved

Access - recalc a Tabbed form Unbound textboxes

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

803 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