Active X names keep changing  
Author Message
JennaB





PostPosted: Sat Mar 04 03:26:21 CST 2006 Top

MS Word VBA >> Active X names keep changing

I am creating a document for which I have several checkboxes and text boxes.
While working with these the names keep changing or a 1 is added. I am using
Word 2003 with all the updates. Is there a fix for this???
--
Thanks,
Darrin

Word112  
 
 
Doug





PostPosted: Sat Mar 04 03:26:21 CST 2006 Top

MS Word VBA >> Active X names keep changing You need to provide more detail of exactly what features you are using. I
steer completely clear of using controls from the Controls Toolbox directly
in a Word document. Better to use either a Userform or FormFields in a
protected document.

--
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 am creating a document for which I have several checkboxes and text
> boxes.
> While working with these the names keep changing or a 1 is added. I am
> using
> Word 2003 with all the updates. Is there a fix for this???
> --
> Thanks,
> Darrin


 
 
Cindy





PostPosted: Tue Mar 07 16:00:01 CST 2006 Top

MS Word VBA >> Active X names keep changing Hi =?Utf-8?B?RGFycmlu?=,

> I am creating a document for which I have several checkboxes and text boxes.
> While working with these the names keep changing or a 1 is added. I am using
> Word 2003 with all the updates. Is there a fix for this???
>
You need to explicitly assign the controls a name (in the Properties window).
Word has a tendency to do this with Shapes, in general, as well as with ActiveX
controls. But as soon as you assign a name, it won't change what you've
assigned.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)

 
 
Darrin





PostPosted: Wed Mar 08 12:09:27 CST 2006 Top

MS Word VBA >> Active X names keep changing I am not familiar with writing code for form fields. Can you get me started
with this and then I should be good to go.

Here is what I am attempting.

I have 4 checkboxes.
Check1, check2, check3 and check4.
If I check check1 then check3 woud be checked.
Then if I check check2 then check3 and check4 would be checked. Even though
check3 is already checked.

Now if I uncheck check1 I do not want check3 to uncheck due to check2 still
being checked.

How will the properties be set for these?

Thank you for your time.
--
Thanks,
Darrin




> You need to provide more detail of exactly what features you are using. I
> steer completely clear of using controls from the Controls Toolbox directly
> in a Word document. Better to use either a Userform or FormFields in a
> protected document.
>
> --
> 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 am creating a document for which I have several checkboxes and text
> > boxes.
> > While working with these the names keep changing or a 1 is added. I am
> > using
> > Word 2003 with all the updates. Is there a fix for this???
> > --
> > Thanks,
> > Darrin
>
>
>
 
 
Doug





PostPosted: Wed Mar 08 15:25:02 CST 2006 Top

MS Word VBA >> Active X names keep changing Sounds like you are actually using formfields in a protected document, in
which case you would run the following macro on exit from Check1

With ActiveDocument
If .FormFields("Check1").CheckBox.Value = True Then
.FormFields("Check3").CheckBox.Value = True
ElseIf .FormFields("Check2").CheckBox.Value = False Then
.FormFields("Check3").CheckBox.Value = False
End If
End With

and the following on exit from Check2

With ActiveDocument
If .FormFields("Check2").CheckBox.Value = True Then
.FormFields("Check3").CheckBox.Value = True
.FormFields("Check4").CheckBox.Value = True
Else
.FormFields("Check4").CheckBox.Value = False
End If
If .FormFields("Check2").CheckBox.Value = False Then
If .FormFields("Check1").CheckBox.Value = False Then
.FormFields("Check3").CheckBox.Value = False
End If
End If
End With


--
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 am not familiar with writing code for form fields. Can you get me started
> with this and then I should be good to go.
>
> Here is what I am attempting.
>
> I have 4 checkboxes.
> Check1, check2, check3 and check4.
> If I check check1 then check3 woud be checked.
> Then if I check check2 then check3 and check4 would be checked. Even
> though
> check3 is already checked.
>
> Now if I uncheck check1 I do not want check3 to uncheck due to check2
> still
> being checked.
>
> How will the properties be set for these?
>
> Thank you for your time.
> --
> Thanks,
> Darrin
>
>

>
>> You need to provide more detail of exactly what features you are using.
>> I
>> steer completely clear of using controls from the Controls Toolbox
>> directly
>> in a Word document. Better to use either a Userform or FormFields in a
>> protected document.
>>
>> --
>> 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 am creating a document for which I have several checkboxes and text
>> > boxes.
>> > While working with these the names keep changing or a 1 is added. I am
>> > using
>> > Word 2003 with all the updates. Is there a fix for this???
>> > --
>> > Thanks,
>> > Darrin
>>
>>
>>


 
 
Darrin





PostPosted: Thu Mar 09 07:39:16 CST 2006 Top

MS Word VBA >> Active X names keep changing It didn't work. I may be missing something. I simplified the code down to
this and it still doesn't work. Check1 would be checked and nothing else
would happen. Actually it seems like both macros are running at the same
time. Could I have a VB problem?

Yes this is a protected.

With ActiveDocument
If .FormFields("check1").CheckBox.Value = True Then
.FormFields("check3").CheckBox.Value = True
Else
.FormFields("check4").CheckBox.Value = True
End If
End With
--
Thanks,
Darrin




> Sounds like you are actually using formfields in a protected document, in
> which case you would run the following macro on exit from Check1
>
> With ActiveDocument
> If .FormFields("Check1").CheckBox.Value = True Then
> .FormFields("Check3").CheckBox.Value = True
> ElseIf .FormFields("Check2").CheckBox.Value = False Then
> .FormFields("Check3").CheckBox.Value = False
> End If
> End With
>
> and the following on exit from Check2
>
> With ActiveDocument
> If .FormFields("Check2").CheckBox.Value = True Then
> .FormFields("Check3").CheckBox.Value = True
> .FormFields("Check4").CheckBox.Value = True
> Else
> .FormFields("Check4").CheckBox.Value = False
> End If
> If .FormFields("Check2").CheckBox.Value = False Then
> If .FormFields("Check1").CheckBox.Value = False Then
> .FormFields("Check3").CheckBox.Value = False
> End If
> End If
> End With
>
>
> --
> 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 am not familiar with writing code for form fields. Can you get me started
> > with this and then I should be good to go.
> >
> > Here is what I am attempting.
> >
> > I have 4 checkboxes.
> > Check1, check2, check3 and check4.
> > If I check check1 then check3 woud be checked.
> > Then if I check check2 then check3 and check4 would be checked. Even
> > though
> > check3 is already checked.
> >
> > Now if I uncheck check1 I do not want check3 to uncheck due to check2
> > still
> > being checked.
> >
> > How will the properties be set for these?
> >
> > Thank you for your time.
> > --
> > Thanks,
> > Darrin
> >
> >

> >
> >> You need to provide more detail of exactly what features you are using.
> >> I
> >> steer completely clear of using controls from the Controls Toolbox
> >> directly
> >> in a Word document. Better to use either a Userform or FormFields in a
> >> protected document.
> >>
> >> --
> >> 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 am creating a document for which I have several checkboxes and text
> >> > boxes.
> >> > While working with these the names keep changing or a 1 is added. I am
> >> > using
> >> > Word 2003 with all the updates. Is there a fix for this???
> >> > --
> >> > Thanks,
> >> > Darrin
> >>
> >>
> >>
>
>
>
 
 
Jean-Guy





PostPosted: Thu Mar 09 07:59:18 CST 2006 Top

MS Word VBA >> Active X names keep changing Darrin was telling us:
Darrin nous racontait que :

> It didn't work. I may be missing something. I simplified the code
> down to this and it still doesn't work. Check1 would be checked and
> nothing else would happen. Actually it seems like both macros are
> running at the same time. Could I have a VB problem?
>

Doug's code works as advertised...

Are you sure you are clicking in another field after clicking on Check1 or
Check2?
Remember that these are "OnExit" macros, they will not fire until you click
in a second field.

Also, make sure that your checkbox names match those used in the macro.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP

Word MVP site: http://www.word.mvps.org


 
 
Darrin





PostPosted: Fri Mar 10 14:33:27 CST 2006 Top

MS Word VBA >> Active X names keep changing Thanks, I didn't realize I had to click off to a second field. Is there away
to get around that??? My users are are used to instant gratification of the
other check boxes being filled. I tried changing it to run on entry and that
worked the same.
--
Thanks,
Darrin




> Darrin was telling us:
> Darrin nous racontait que :
>
> > It didn't work. I may be missing something. I simplified the code
> > down to this and it still doesn't work. Check1 would be checked and
> > nothing else would happen. Actually it seems like both macros are
> > running at the same time. Could I have a VB problem?
> >
>
> Doug's code works as advertised...
>
> Are you sure you are clicking in another field after clicking on Check1 or
> Check2?
> Remember that these are "OnExit" macros, they will not fire until you click
> in a second field.
>
> Also, make sure that your checkbox names match those used in the macro.
>
> --
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP

> Word MVP site: http://www.word.mvps.org
>
>
>
 
 
Jean-Guy





PostPosted: Fri Mar 10 19:30:57 CST 2006 Top

MS Word VBA >> Active X names keep changing Darrin was telling us:
Darrin nous racontait que :

> Thanks, I didn't realize I had to click off to a second field. Is

This is what OnExit means, you have to Exit the field...

> there away to get around that??? My users are are used to instant
> gratification of the other check boxes being filled. I tried changing
> it to run on entry and that worked the same.
>

OnEntry is no good since the macro react to user input, which is not yet
known "on entry."

The only way around that that I can think of right now is to use a
userform...


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP

Word MVP site: http://www.word.mvps.org