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

Tip: Looking for answers? Try searching our database.

Problem with Checkbox macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RW - 03 Mar 2007 15:17 GMT
I have a Word template that is opened from Access. I pass the contents of
several bookmarks to the document. The document contains 4 checkboxes
(formfields) and 4 textboxes (formfields). The document is protected.
I need Textbox1 to contain today's date if Checkbox1's value is true. I've
created the macro below. I've tried putting it in the Enter and also into the
Exit portion of the checkbox1 properties. I can not get the macro to fire.
Here's the code:

Sub test1()
With ActiveDocument.FormFields("Check1").CheckBox
   If .Value = True Then
      ActiveDocument.FormFields("Text1").Result = Date
   Else
       ActiveDocument.FormFields("Text1").Result = ""
   End If
End With
End Sub

What I'm trying to do:
I need to create a signoff document. The data is in Access. I want to create
a Word document that can be routed to several users (Word Routing) and have
them sign off by clicking a box. I've got code in place to determine the
current user and it only enables checkboxes they can click. The Access code
also saves the initial document to a specified directory with a name from
data in the database.

When the document is opened, I would like a msgbox to appear letting the
user know which level of authority they can check.

I just realized the users will not have access to the underlying template -
is this necessary? Will the code be passed to the created Word document? Is
there a different approach that would be better?
Jezebel - 03 Mar 2007 22:41 GMT
Better to do all the coding in one place, Access in this case. Create the
document. Unprotect it. Set the values directly. Protect it. Then launch it
for the user.

>I have a Word template that is opened from Access. I pass the contents of
> several bookmarks to the document. The document contains 4 checkboxes
[quoted text clipped - 34 lines]
> Is
> there a different approach that would be better?
RW - 04 Mar 2007 01:30 GMT
OK, I can set it for the first user's level to check from Access. The first
user will have access to underlying template. However, the first user will
need to email it (routing it to a list) to the next level for their
checkmark. That person will not have access to the document's underlying
template. Niether will the next 2 routing recipients. It seems like I need to
get the code to pass along with the document.

The reason I'm trying to add the code is to be able to only allow a user to
be able to check their level's checkbox. I don't want them to uncheck someone
else's or check a higher level than they have been authorized for.

> Better to do all the coding in one place, Access in this case. Create the
> document. Unprotect it. Set the values directly. Protect it. Then launch it
> for the user.
Jezebel - 04 Mar 2007 01:37 GMT
Don't try emailing documents with code attached. Any half-way decent
security system will delete your document immediately if it has code in it,
for obvious reasons. If you're trying to automate workflow or document
authorisation, use an application designed for the purpose; or put your
document on an intranet and email links to it.

> OK, I can set it for the first user's level to check from Access. The
> first
[quoted text clipped - 15 lines]
>> it
>> for the user.
 
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.