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 / August 2007

Tip: Looking for answers? Try searching our database.

Populating checkboxes from saved values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
liz@TheTangoClub.com - 19 Aug 2007 19:57 GMT
I have a userform (in Word) Initially it runs successfully and fields
stored as custom field sin file properties are updated as expected. I
need to be able to rerun the userform to allow update, relatively
simple I thought. Yes, it all works except for the checkbox items. I
have tried custom fields defined as text and yes/no and although they
are initially updated I can't retreive the data when I rerun the
userform I get a run time error 5 invalid procedure.  Do I need to do
something special to get the  -1 and 0 (yes and no) to populate the
check boxes?

luca
Doug Robbins - Word MVP - 19 Aug 2007 20:41 GMT
Use a MsgBox statement to find out what is actually stored in the respective
custom fields (I am not really sure what you mean by that - Document
Variables or Custom Document Properties?)

You may then need to use and If... Else...End If construction to covert that
data to boolean True or False for the checkbox.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a userform (in Word) Initially it runs successfully and fields
> stored as custom field sin file properties are updated as expected. I
[quoted text clipped - 7 lines]
>
> luca
liz@TheTangoClub.com - 19 Aug 2007 21:49 GMT
> Use a MsgBox statement to find out what is actually stored in the respective
> custom fields (I am not really sure what you mean by that - Document
[quoted text clipped - 26 lines]
>
> > luca

Doug,

I will try that, although I already know (visually) that the custom
fileds - yes, I mean the custom document properties hold -1 or 0 if
they are defined as text fields. If they are yes/no I'm not sure but I
would guess the underlying values would be the same since that is the
convention. Mingd you I also know that my debug statements for the
initial execution of the userform report the values as True & False,
but I have always understood that these are held as -1 and 0. It
doesn't make sense to me that I can set the values using the user form
and there are no reported erros and the values look OK, but to
redisplay the exact thing it has just saved doesn't work and my need
some sort of manipulation?!

Anyway I will have another go...

Luca
Doug Robbins - Word MVP - 19 Aug 2007 22:41 GMT
It appears that you need to set the .Value of the check box to either "True"
or "False" - without the quotes.  Setting to either -1 or 0, while it causes
a tick to be displayed in the checkbox, does not really result in the .Value
of the checkbox being set as a subsequent

MsgBox CheckBox1.Value

returns and invalid use of Null error message and that is what the checkbox
is actually set to if you hover over it after going to Debug.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>> Use a MsgBox statement to find out what is actually stored in the
>> respective
[quoted text clipped - 46 lines]
>
> Luca
 
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.