Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
JuanManuel JuanManuel is offline
external usenet poster
 
Posts: 1
Default Checkbox in an If statement

Upon saving, I'm trying to show a messagebox when none of the 4 checkboxes in
the document are checked and to cancel saving.

I'm using checkboxes from the control toolbox.

It's giving me an error on the If statement called: Run-time error '424".
Object required.

This is the code that I'm using:

Sub FileSaveAll()
If ChkboxTMS1.Value = False And ChkboxTMS2.Value = False And
ChkboxTMS3.Value = False And ChkboxTMS4.Value = False Then
MsgBox "Please select a radiobutton and retype your changes."
Exit Sub
Else Documents.Save
End If
End Sub

Any thoughts?

Thank you

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Checkbox in an If statement

Hi JuanManuel,

Upon saving, I'm trying to show a messagebox when none of the 4 checkboxes in
the document are checked and to cancel saving.

I'm using checkboxes from the control toolbox.

It's giving me an error on the If statement called: Run-time error '424".
Object required.

In which module is this code located? I think, the way it's set up, it would
have to be in the ThisDocument module to access the activeX controls in this
manner.

This is the code that I'm using:

Sub FileSaveAll()
If ChkboxTMS1.Value = False And ChkboxTMS2.Value = False And
ChkboxTMS3.Value = False And ChkboxTMS4.Value = False Then
MsgBox "Please select a radiobutton and retype your changes."
Exit Sub
Else Documents.Save
End If
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox angelsinger125 Microsoft Word Help 2 December 26th 07 05:00 PM
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
Checkbox Danny Microsoft Word Help 9 May 1st 06 06:16 PM
Checkable checkbox stev379 Microsoft Word Help 2 July 15th 05 09:01 PM


All times are GMT +1. The time now is 10:15 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"