> Just about to leave for the weekend... just had an idea.. don't know if it
> will work...
[quoted text clipped - 7 lines]
> fields on the same row to their default value (0) and disable them. If it is
> not 0, enable the fields on the same row.
Hi,
Thank you for your suggestion. Would this look like an "IF" calculation? I'm
fairly new to VBA scripting; how would such a code best be written so that if
Score1 = 0, then Score2 and Score3 also = 0, but if Score1>0, Score2 and
Score3 are whatever score they are?
Karen
Jean-Guy Marcil - 25 Mar 2008 17:42 GMT
> > Just about to leave for the weekend... just had an idea.. don't know if it
> > will work...
[quoted text clipped - 13 lines]
> Score1 = 0, then Score2 and Score3 also = 0, but if Score1>0, Score2 and
> Score3 are whatever score they are?
To test my macro, set up a table as follows:
5 columns
Columns 2, 3 and 4 contain textinput formfields of the "Number" type with a
default value set to "0". Also, check the "Calculate on Exit" property.
The fields in column 2 also have the following macro (ToggleZero) set On Exit.
Column 5 contains a calculation formfield witht he following formula:
=SUM(LEFT)
Make sure that each cells contains nothing but one single formfield as
described above.
Do not forget to protect the document before testing it.
Now, here is the macro:
Sub ToggleZero()
With Selection
If .Cells(1).Range.FormFields(1).Result = 0 Then
With .Rows(1).Cells(3).Range.FormFields(1)
.Result = .TextInput.Default
.Enabled = False
End With
With .Rows(1).Cells(4).Range.FormFields(1)
.Result = .TextInput.Default
.Enabled = False
End With
Else
With .Rows(1).Cells(3).Range.FormFields(1)
.Enabled = True
End With
With .Rows(1).Cells(4).Range.FormFields(1)
.Enabled = True
End With
End If
End With
End Sub
kW in mD - 27 Mar 2008 13:50 GMT
> > > Just about to leave for the weekend... just had an idea.. don't know if it
> > > will work...
[quoted text clipped - 54 lines]
>
> This worked beautifully! Thank you very much for your help.
Karen