Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

Calc on Exit...from Slider bar?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TomorrowsMan - 30 Mar 2006 23:17 GMT
I have a slider bar (Scrollbar1) that chooses a value between 1 and 4.
That value then populates my userform at bookmark "Row1Total" via this
VBA:

Private Sub Scrollbar1_Change()

ActiveDocument.FormFields("Row1Total").Result = ScrollBar1.Value

End Sub

There are three slider bars altogether, and as each one is assigned a
value, I would like the "total' at the bottom to update automatically.

My calculation field (ManSub1) is:  =Row1Total+Row2Total+Row3Total

Each of the three form fields update just fine as the slider bar is
moved; and, they are set to calculate on Exit; however, the total in
ManSub1 does not update.

Help?

Cheers,
TMan
Jean-Guy Marcil - 03 Apr 2006 16:02 GMT
TomorrowsMan was telling us:
TomorrowsMan nous racontait que :

> I have a slider bar (Scrollbar1) that chooses a value between 1 and 4.
> That value then populates my userform at bookmark "Row1Total" via this
[quoted text clipped - 5 lines]
>
> End Sub

According to this code, your are not populating a field on a userform, but
in the document itself.

> There are three slider bars altogether, and as each one is assigned a
> value, I would like the "total' at the bottom to update automatically.
[quoted text clipped - 4 lines]
> moved; and, they are set to calculate on Exit; however, the total in
> ManSub1 does not update.

For "On Exit" to work you have to actually enter the field and then exit it
from within the document, not with code.

You need to use the ".Fields.Update" method.

See the examples in the on line VBA help.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.