Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Sat, 16 Aug 2008 22:06:06 +0200,    group: microsoft.public.word.vba.beginners        back       


Select CheckBox FormField hell ;-)   
Dear Word-experts,

I have this 'simple' scheme of checkbox form fields. For reasons of 
document lay-out, the days must be on top. 
=============
     Mo   Tu   We   Th   Fr
AM   []   []   []   []   []
PM   []   []   []   []   []
=============
No problem to use if you'd like to fill in from left to right.
But ... I want the order to be Mo-AM, Mo-PM, Tu-Am, Tu-PM, We-AM
etc. So vertical by weekday. This must haven been done before ;-).
So I added ExitMacros specifying the next field to select. The '*' 
marks.
=============
    Mo   Tu   We   Th   Fr
AM  []*  []*  []*  []*  []*
PM  []*  []*  []*  []*  []
=============
This turns the scheme into living 'hell'. 

I read the article "How to validate the contents of a form field in 
a Word form" by Dave Rado. It acknolewdges the problem but doesn't
give a final solution for me. Probably because I deal with a 
sequence of fields. 
In simple situations (not a sequence of ExitMacro-fields)
=============
ActiveDocument.FormFields("chkBeschikbaarMaMi").PREVIOUS.Select
=============
works.

I also tried to deactivate the <Tab> by 
=============
Sub Dummy()
End Sub

Sub Crazy()
  'Deactivate the <Tab>-key
  CustomizationContext = ActiveDocument
  KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyTab), _
    KeyCategory:=wdKeyCategoryCommand, Command:="Dummy"
  'Select the proper field
  ActiveDocument.FormFields("chkBeschikbaarMaMi").Select
  'Reactivate the <Tab>-key
  CustomizationContext = ActiveDocument
  KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyTab), _
    KeyCategory:=wdKeyCategoryDisable, Command:=""
End Sub
=============
This type of code works in a regular document by not while using
fields: error code ###### ...

My workaround: jump to a dummy field (indicated in the scheme by
a '|', formatted as Hidden text. The 'demon Word' by itself 
selects the next true field.
=============
    Mo   Tu   We   Th   Fr
AM  []*  |[]* |[]* |[]* |[]*
PM  |[]* |[]* |[]* |[]* |[]
=============
This 'works' but, as this will have been done before: what is
the proper approach?

A working sample of the document can be downloaded from:
http://www.fhvzelm.com/?page=cursus

Met vriendelijke groeten,
Frans H. van Zelm
fhvzelm@doge.nl
www.fhvzelm.com
date: Sat, 16 Aug 2008 22:06:06 +0200   author:   F.H. van Zelm

Re: Select CheckBox FormField hell ;-)   
Use a two row, 6 column table construction (without borders if desired)

      Mo    Tu    We    Th    Fr     
AM¶   []¶   []¶   []¶   []¶   []¶
PM    []    []    []    []    []

with the AM and the PM and the corresponding checkboxes all in one row, with the enter key pressed where indicated by the ¶ in the above layout.  Then, without anything else being required, pressing the tab key will move the selection through the formfields in the order that you are after.
-- 
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

  "F.H. van Zelm"  wrote in message news:uNZEft9$IHA.3648@TK2MSFTNGP02.phx.gbl...
  Dear Word-experts,

  I have this 'simple' scheme of checkbox form fields. For reasons of 
  document lay-out, the days must be on top. 
  =============
       Mo   Tu   We   Th   Fr
  AM   []   []   []   []   []
  PM   []   []   []   []   []
  =============
  No problem to use if you'd like to fill in from left to right.
  But ... I want the order to be Mo-AM, Mo-PM, Tu-Am, Tu-PM, We-AM
  etc. So vertical by weekday. This must haven been done before ;-).
  So I added ExitMacros specifying the next field to select. The '*' 
  marks.
  =============
      Mo   Tu   We   Th   Fr
  AM  []*  []*  []*  []*  []*
  PM  []*  []*  []*  []*  []
  =============
  This turns the scheme into living 'hell'. 

  I read the article "How to validate the contents of a form field in 
  a Word form" by Dave Rado. It acknolewdges the problem but doesn't
  give a final solution for me. Probably because I deal with a 
  sequence of fields. 
  In simple situations (not a sequence of ExitMacro-fields)
  =============
  ActiveDocument.FormFields("chkBeschikbaarMaMi").PREVIOUS.Select
  =============
  works.

  I also tried to deactivate the <Tab> by 
  =============
  Sub Dummy()
  End Sub

  Sub Crazy()
    'Deactivate the <Tab>-key
    CustomizationContext = ActiveDocument
    KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyTab), _
      KeyCategory:=wdKeyCategoryCommand, Command:="Dummy"
    'Select the proper field
    ActiveDocument.FormFields("chkBeschikbaarMaMi").Select
    'Reactivate the <Tab>-key
    CustomizationContext = ActiveDocument
    KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyTab), _
      KeyCategory:=wdKeyCategoryDisable, Command:=""
  End Sub
  =============
  This type of code works in a regular document by not while using
  fields: error code ###### ...

  My workaround: jump to a dummy field (indicated in the scheme by
  a '|', formatted as Hidden text. The 'demon Word' by itself 
  selects the next true field.
  =============
      Mo   Tu   We   Th   Fr
  AM  []*  |[]* |[]* |[]* |[]*
  PM  |[]* |[]* |[]* |[]* |[]
  =============
  This 'works' but, as this will have been done before: what is
  the proper approach?

  A working sample of the document can be downloaded from:
  http://www.fhvzelm.com/?page=cursus

  Met vriendelijke groeten,
  Frans H. van Zelm
  fhvzelm@doge.nl
  www.fhvzelm.com
date: Sun, 17 Aug 2008 08:04:06 +1000   author:   Doug Robbins - Word MVP

Re: Select CheckBox FormField hell ;-)   
Hi Doug,

To begin with: in my mail, I completely forgot to mention that the
formfields are in a three-row-six-column table. Sorry.

I tried with the <Enter>s (¶) in the table and I found that only AM¶ is
needed.
I formatted the ¶ as hidden text to make the table display as a
single row. Problem fixed, life can be so easy.

Funny, amazing and you're great! Can you also give some kind of
explaination? I'd love to understand the WHY. How did you find this
solution?

Frans van Zelm

"Doug Robbins - Word MVP"  schreef in bericht
news:%23TrCDw%23$IHA.4536@TK2MSFTNGP05.phx.gbl...
Use a two row, 6 column table construction (without borders if desired)
      Mo    Tu    We    Th    Fr
AM¶   []¶   []¶   []¶   []¶   []¶
PM    []    []    []    []    []
etc.
date: Tue, 19 Aug 2008 23:52:29 +0200   author:   F.H. van Zelm

Re: Select CheckBox FormField hell ;-)   
The explanation is that the tab key moves to all of the controls in one cell 
of a table before moving to the first of the controls in the next cell.

-- 
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

"F.H. van Zelm"  wrote in message 
news:ODqi2WkAJHA.3756@TK2MSFTNGP02.phx.gbl...
> Hi Doug,
>
> To begin with: in my mail, I completely forgot to mention that the
> formfields are in a three-row-six-column table. Sorry.
>
> I tried with the <Enter>s (¶) in the table and I found that only AM¶ is
> needed.
> I formatted the ¶ as hidden text to make the table display as a
> single row. Problem fixed, life can be so easy.
>
> Funny, amazing and you're great! Can you also give some kind of
> explaination? I'd love to understand the WHY. How did you find this
> solution?
>
> Frans van Zelm
>
> "Doug Robbins - Word MVP"  schreef in bericht
> news:%23TrCDw%23$IHA.4536@TK2MSFTNGP05.phx.gbl...
> Use a two row, 6 column table construction (without borders if desired)
>      Mo    Tu    We    Th    Fr
> AM¶   []¶   []¶   []¶   []¶   []¶
> PM    []    []    []    []    []
> etc.
>
>
>
date: Wed, 20 Aug 2008 11:06:36 +1000   author:   Doug Robbins - Word MVP

Re: Select CheckBox FormField hell ;-)   
Hi Doug,

Last night I must haven been completely drunk or something. Because:
- I misunderstood you and created a three (3!) row table
- then I added the <Enter> (¶), only in the AM-cell
- and it worked! ? !
At least, that's what I remember and I tried for several times. This morning
I started implemeting the 'solution' in the fill-in form and it didn't work 
...
No copy left of the documents of last night, of course as they were
Test.docs

So I reread your first answer and now also your explanation. Aha: a two-row
table ... And then it is very clear why Word moves from AM to PM as the cell
is a unit.
I added a drawn line in between AM and PM to restore the table cell-look.

Still wondering about what was going on last night. Big Bill's angel looking
over my shoulder?

Thanks anyway, Frans
www.fhvzelm.com

"Doug Robbins - Word MVP"  schreef in bericht
news:%23wk9$DmAJHA.4528@TK2MSFTNGP05.phx.gbl...
> The explanation is that the tab key moves to all of the controls in one
> cell of a table before moving to the first of the controls in the next
> cell.
>
> -- 
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> etc.
date: Wed, 20 Aug 2008 11:18:38 +0200   author:   F.H. van Zelm

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us