Is there a simple way to add a bookmark reference to a userform popup?
The user selects five ratings of 1-4, which get totaled to the bookmark
CompTot1 when the user clicks a "Validate" command_button on the page.
I would like a UserForm to popup that says, "Your subtotal is
[CompTot1]. Is this a performance review?
At that point the user clicks on command_button YES or NO, which takes
them to one of two different bookmarks.
I have the second half completed; but I'm finding it tricky to get the
CompTot1 bookmark subtotal into the UserForm; there's lots of info on
how to get userform data 'down' to the form, but not 'up' from it, if
that makes sense....
Thanks!
Chris
Greg Maxey - 27 Apr 2006 17:34 GMT
Chris,
Say you want the value of CompTot1 in textbox1 of the form:
Private Sub UserForm_Initialize()
Me.TextBox1.Value = ActiveDocument.Bookmarks("CompTot1").Range.Text
End Sub
TomorrowsMan - 01 May 2006 23:28 GMT
Thank you!
It's almost perfect -- the only thing is, it returns the value
"FORMTEXT X.XX," where X.XX is the number I am trying to show in the
userform. So instead of getting "Your rating is 3.50" I am getting
"Your rating is FORMTEXT 3.50".
Any way to truncate this to just the number?
Thanks again!
Chris
TomorrowsMan - 02 May 2006 16:39 GMT
Ah, ha! think I figured it out!
I added your script to the UserForm_Activate() Sub, and that seems to
be doing the trick!
Thanks again!