Option Group click error

  • Thread starter Thread starter Rob C
  • Start date Start date
R

Rob C

Using AccessXP and a continuous form... I am trying to capture information
for 5 quarters each containing 13 weeks of info... so I have a table with 65
fields(Columns). I have an Option group which upon update essentially
switches which 13 fields are shown in the detail section of the Form.
Incidentally, some fields (columns) are disabled if the time has already
passed...

Some users are experiencing the following error when switching from optWk =
1 to optWk = 2... others are just fine.

The expression After Update you entered as the event property setting
produced the following error: The control or subform command control is too
large for this location.

The code invoked by the option group update is as follows...

What amI be doing wrong ?



Private Sub optWk_AfterUpdate()

Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("qrytblHeaders")

'This section puts the appropriate Month / Week in Header section of the
form

rs.MoveFirst
If [Forms]![frmF]!optWk = 1 Then
[Forms]![frmF]![MW1] = rs!L1
[Forms]![frmF]![MW2] = rs!L2
[Forms]![frmF]![MW3] = rs!L3
[Forms]![frmF]![MW4] = rs!L4
[Forms]![frmF]![MW5] = rs!L5
[Forms]![frmF]![MW6] = rs!L6
[Forms]![frmF]![MW7] = rs!L7
[Forms]![frmF]![MW8] = rs!L8
[Forms]![frmF]![MW9] = rs!L9
[Forms]![frmF]![MW10] = rs!L10
[Forms]![frmF]![MW11] = rs!L11
[Forms]![frmF]![MW12] = rs!L12
[Forms]![frmF]![MW13] = rs!L13
End If
If [Forms]![frmF]!optWk = 2 Then
[Forms]![frmF]![MW1] = rs!L14
[Forms]![frmF]![MW2] = rs!L15
[Forms]![frmF]![MW3] = rs!L16
[Forms]![frmF]![MW4] = rs!L17
[Forms]![frmF]![MW5] = rs!L18
[Forms]![frmF]![MW6] = rs!L19
[Forms]![frmF]![MW7] = rs!L20
[Forms]![frmF]![MW8] = rs!L21
[Forms]![frmF]![MW9] = rs!L22
[Forms]![frmF]![MW10] = rs!L23
[Forms]![frmF]![MW11] = rs!L24
[Forms]![frmF]![MW12] = rs!L25
[Forms]![frmF]![MW13] = rs!L26
End If
If [Forms]![frmF]!optWk = 3 Then
[Forms]![frmF]![MW1] = rs!L27
[Forms]![frmF]![MW2] = rs!L28
[Forms]![frmF]![MW3] = rs!L29
[Forms]![frmF]![MW4] = rs!L30
[Forms]![frmF]![MW5] = rs!L31
[Forms]![frmF]![MW6] = rs!L32
[Forms]![frmF]![MW7] = rs!L33
[Forms]![frmF]![MW8] = rs!L34
[Forms]![frmF]![MW9] = rs!L35
[Forms]![frmF]![MW10] = rs!L36
[Forms]![frmF]![MW11] = rs!L37
[Forms]![frmF]![MW12] = rs!L38
[Forms]![frmF]![MW13] = rs!L39
End If
If [Forms]![frmF]!optWk = 4 Then
[Forms]![frmF]![MW1] = rs!L40
[Forms]![frmF]![MW2] = rs!L41
[Forms]![frmF]![MW3] = rs!L42
[Forms]![frmF]![MW4] = rs!L43
[Forms]![frmF]![MW5] = rs!L44
[Forms]![frmF]![MW6] = rs!L45
[Forms]![frmF]![MW7] = rs!L46
[Forms]![frmF]![MW8] = rs!L47
[Forms]![frmF]![MW9] = rs!L48
[Forms]![frmF]![MW10] = rs!L49
[Forms]![frmF]![MW11] = rs!L50
[Forms]![frmF]![MW12] = rs!L51
[Forms]![frmF]![MW13] = rs!L52
End If
If [Forms]![frmF]!optWk = 5 Then
[Forms]![frmF]![MW1] = rs!L53
[Forms]![frmF]![MW2] = rs!L54
[Forms]![frmF]![MW3] = rs!L55
[Forms]![frmF]![MW4] = rs!L56
[Forms]![frmF]![MW5] = rs!L57
[Forms]![frmF]![MW6] = rs!L58
[Forms]![frmF]![MW7] = rs!L59
[Forms]![frmF]![MW8] = rs!L60
[Forms]![frmF]![MW9] = rs!L61
[Forms]![frmF]![MW10] = rs!L62
[Forms]![frmF]![MW11] = rs!L63
[Forms]![frmF]![MW12] = rs!L64
[Forms]![frmF]![MW13] = rs!L65
End If
[Forms]![frmF].Refresh
rs.Close
Set rs = Nothing

db.Close
Set db = Nothing

If [Forms]![frmF]!optWk = 1 Then
If [Forms]![frmF]![DisableThru] >= 1 Then
[Forms]![frmF]![1].Enabled = False
[Forms]![frmF]![1].Locked = True
Else
[Forms]![frmF]![1].Enabled = True
[Forms]![frmF]![1].Locked = False
End If
[Forms]![frmF]![1].Visible = True
[Forms]![frmF]![1].Top = 0

If [Forms]![frmF]![DisableThru] >= 2 Then
[Forms]![frmF]![2].Enabled = False
[Forms]![frmF]![2].Locked = True
Else
[Forms]![frmF]![2].Enabled = True
[Forms]![frmF]![2].Locked = False
End If
[Forms]![frmF]![2].Visible = True
[Forms]![frmF]![2].Top = 0

If [Forms]![frmF]![DisableThru] >= 3 Then
[Forms]![frmF]![3].Enabled = False
[Forms]![frmF]![3].Locked = True
Else
[Forms]![frmF]![3].Enabled = True
[Forms]![frmF]![3].Locked = False
End If
[Forms]![frmF]![3].Visible = True
[Forms]![frmF]![3].Top = 0

If [Forms]![frmF]![DisableThru] >= 4 Then
[Forms]![frmF]![4].Enabled = False
[Forms]![frmF]![4].Locked = True
Else
[Forms]![frmF]![4].Enabled = True
[Forms]![frmF]![4].Locked = False
End If
[Forms]![frmF]![4].Visible = True
[Forms]![frmF]![4].Top = 0

If [Forms]![frmF]![DisableThru] >= 5 Then
[Forms]![frmF]![5].Enabled = False
[Forms]![frmF]![5].Locked = True
Else
[Forms]![frmF]![5].Enabled = True
[Forms]![frmF]![5].Locked = False
End If
[Forms]![frmF]![5].Visible = True
[Forms]![frmF]![5].Top = 0

If [Forms]![frmF]![DisableThru] >= 6 Then
[Forms]![frmF]![6].Enabled = False
[Forms]![frmF]![6].Locked = True
Else
[Forms]![frmF]![6].Enabled = True
[Forms]![frmF]![6].Locked = False
End If
[Forms]![frmF]![6].Visible = True
[Forms]![frmF]![6].Top = 0

If [Forms]![frmF]![DisableThru] >= 7 Then
[Forms]![frmF]![7].Enabled = False
[Forms]![frmF]![7].Locked = True
Else
[Forms]![frmF]![7].Enabled = True
[Forms]![frmF]![7].Locked = False
End If
[Forms]![frmF]![7].Visible = True
[Forms]![frmF]![7].Top = 0

If [Forms]![frmF]![DisableThru] >= 8 Then
[Forms]![frmF]![8].Enabled = False
[Forms]![frmF]![8].Locked = True
Else
[Forms]![frmF]![8].Enabled = True
[Forms]![frmF]![8].Locked = False
End If
[Forms]![frmF]![8].Visible = True
[Forms]![frmF]![8].Top = 0

If [Forms]![frmF]![DisableThru] >= 9 Then
[Forms]![frmF]![9].Enabled = False
[Forms]![frmF]![9].Locked = True
Else
[Forms]![frmF]![9].Enabled = True
[Forms]![frmF]![9].Locked = False
End If
[Forms]![frmF]![9].Visible = True
[Forms]![frmF]![9].Top = 0

If [Forms]![frmF]![DisableThru] >= 10 Then
[Forms]![frmF]![10].Enabled = False
[Forms]![frmF]![10].Locked = True
Else
[Forms]![frmF]![10].Enabled = True
[Forms]![frmF]![10].Locked = False
End If
[Forms]![frmF]![10].Visible = True
[Forms]![frmF]![10].Top = 0

If [Forms]![frmF]![DisableThru] >= 11 Then
[Forms]![frmF]![11].Enabled = False
[Forms]![frmF]![11].Locked = True
Else
[Forms]![frmF]![11].Enabled = True
[Forms]![frmF]![11].Locked = False
End If
[Forms]![frmF]![11].Visible = True
[Forms]![frmF]![11].Top = 0

If [Forms]![frmF]![DisableThru] >= 12 Then
[Forms]![frmF]![12].Enabled = False
[Forms]![frmF]![12].Locked = True
Else
[Forms]![frmF]![12].Enabled = True
[Forms]![frmF]![12].Locked = False
End If
[Forms]![frmF]![12].Visible = True
[Forms]![frmF]![12].Top = 0

If [Forms]![frmF]![DisableThru] >= 13 Then
[Forms]![frmF]![13].Enabled = False
[Forms]![frmF]![13].Locked = True
Else
[Forms]![frmF]![13].Enabled = True
[Forms]![frmF]![13].Locked = False
End If
[Forms]![frmF]![13].Visible = True
[Forms]![frmF]![13].Top = 0

[Forms]![frmF]![SmQ1].Visible = True
[Forms]![frmF]![SmQ1].Top = 0

Else
[Forms]![frmF]![1].Enabled = False
[Forms]![frmF]![1].Locked = True
[Forms]![frmF]![1].Visible = False

[Forms]![frmF]![2].Enabled = False
[Forms]![frmF]![2].Locked = True
[Forms]![frmF]![2].Visible = False

[Forms]![frmF]![3].Enabled = False
[Forms]![frmF]![3].Locked = True
[Forms]![frmF]![3].Visible = False

[Forms]![frmF]![4].Enabled = False
[Forms]![frmF]![4].Locked = True
[Forms]![frmF]![4].Visible = False

[Forms]![frmF]![5].Enabled = False
[Forms]![frmF]![5].Locked = True
[Forms]![frmF]![5].Visible = False

[Forms]![frmF]![6].Enabled = False
[Forms]![frmF]![6].Locked = True
[Forms]![frmF]![6].Visible = False

[Forms]![frmF]![7].Enabled = False
[Forms]![frmF]![7].Locked = True
[Forms]![frmF]![7].Visible = False

[Forms]![frmF]![8].Enabled = False
[Forms]![frmF]![8].Locked = True
[Forms]![frmF]![8].Visible = False

[Forms]![frmF]![9].Enabled = False
[Forms]![frmF]![9].Locked = True
[Forms]![frmF]![9].Visible = False

[Forms]![frmF]![10].Enabled = False
[Forms]![frmF]![10].Locked = True
[Forms]![frmF]![10].Visible = False

[Forms]![frmF]![11].Enabled = False
[Forms]![frmF]![11].Locked = True
[Forms]![frmF]![11].Visible = False

[Forms]![frmF]![12].Enabled = False
[Forms]![frmF]![12].Locked = True
[Forms]![frmF]![12].Visible = False

[Forms]![frmF]![13].Enabled = False
[Forms]![frmF]![13].Locked = True
[Forms]![frmF]![13].Visible = False

[Forms]![frmF]![SmQ1].Visible = False

End If

If [Forms]![frmF]!optWk = 2 Then
[Forms]![frmF]![14].Enabled = True
[Forms]![frmF]![14].Locked = False
[Forms]![frmF]![14].Visible = True
[Forms]![frmF]![14].Top = 0

[Forms]![frmF]![15].Enabled = True
[Forms]![frmF]![15].Locked = False
[Forms]![frmF]![15].Visible = True
[Forms]![frmF]![15].Top = 0

[Forms]![frmF]![16].Enabled = True
[Forms]![frmF]![16].Locked = False
[Forms]![frmF]![16].Visible = True
[Forms]![frmF]![16].Top = 0

[Forms]![frmF]![17].Enabled = True
[Forms]![frmF]![17].Locked = False
[Forms]![frmF]![17].Visible = True
[Forms]![frmF]![17].Top = 0

[Forms]![frmF]![18].Enabled = True
[Forms]![frmF]![18].Locked = False
[Forms]![frmF]![18].Visible = True
[Forms]![frmF]![18].Top = 0

[Forms]![frmF]![19].Enabled = True
[Forms]![frmF]![19].Locked = False
[Forms]![frmF]![19].Visible = True
[Forms]![frmF]![19].Top = 0

[Forms]![frmF]![20].Enabled = True
[Forms]![frmF]![20].Locked = False
[Forms]![frmF]![20].Visible = True
[Forms]![frmF]![20].Top = 0

[Forms]![frmF]![21].Enabled = True
[Forms]![frmF]![21].Locked = False
[Forms]![frmF]![21].Visible = True
[Forms]![frmF]![21].Top = 0

[Forms]![frmF]![22].Enabled = True
[Forms]![frmF]![22].Locked = False
[Forms]![frmF]![22].Visible = True
[Forms]![frmF]![22].Top = 0

[Forms]![frmF]![23].Enabled = True
[Forms]![frmF]![23].Locked = False
[Forms]![frmF]![23].Visible = True
[Forms]![frmF]![23].Top = 0

[Forms]![frmF]![24].Enabled = True
[Forms]![frmF]![24].Locked = False
[Forms]![frmF]![24].Visible = True
[Forms]![frmF]![24].Top = 0

[Forms]![frmF]![25].Enabled = True
[Forms]![frmF]![25].Locked = False
[Forms]![frmF]![25].Visible = True
[Forms]![frmF]![25].Top = 0

[Forms]![frmF]![26].Enabled = True
[Forms]![frmF]![26].Locked = False
[Forms]![frmF]![26].Visible = True
[Forms]![frmF]![26].Top = 0

[Forms]![frmF]![SmQ2].Visible = True
[Forms]![frmF]![SmQ2].Top = 0

Else
[Forms]![frmF]![14].Enabled = False
[Forms]![frmF]![14].Locked = True
[Forms]![frmF]![14].Visible = False

[Forms]![frmF]![15].Enabled = False
[Forms]![frmF]![15].Locked = True
[Forms]![frmF]![15].Visible = False

[Forms]![frmF]![16].Enabled = False
[Forms]![frmF]![16].Locked = True
[Forms]![frmF]![16].Visible = False

[Forms]![frmF]![17].Enabled = False
[Forms]![frmF]![17].Locked = True
[Forms]![frmF]![17].Visible = False

[Forms]![frmF]![18].Enabled = False
[Forms]![frmF]![18].Locked = True
[Forms]![frmF]![18].Visible = False

[Forms]![frmF]![19].Enabled = False
[Forms]![frmF]![19].Locked = True
[Forms]![frmF]![19].Visible = False

[Forms]![frmF]![20].Enabled = False
[Forms]![frmF]![20].Locked = True
[Forms]![frmF]![20].Visible = False

[Forms]![frmF]![21].Enabled = False
[Forms]![frmF]![21].Locked = True
[Forms]![frmF]![21].Visible = False

[Forms]![frmF]![22].Enabled = False
[Forms]![frmF]![22].Locked = True
[Forms]![frmF]![22].Visible = False

[Forms]![frmF]![23].Enabled = False
[Forms]![frmF]![23].Locked = True
[Forms]![frmF]![23].Visible = False

[Forms]![frmF]![24].Enabled = False
[Forms]![frmF]![24].Locked = True
[Forms]![frmF]![24].Visible = False

[Forms]![frmF]![25].Enabled = False
[Forms]![frmF]![25].Locked = True
[Forms]![frmF]![25].Visible = False

[Forms]![frmF]![26].Enabled = False
[Forms]![frmF]![26].Locked = True
[Forms]![frmF]![26].Visible = False

[Forms]![frmF]![SmQ2].Visible = False

End If

If [Forms]![frmF]!optWk = 3 Then
[Forms]![frmF]![27].Enabled = True
[Forms]![frmF]![27].Locked = False
[Forms]![frmF]![27].Visible = True
[Forms]![frmF]![27].Top = 0

[Forms]![frmF]![28].Enabled = True
[Forms]![frmF]![28].Locked = False
[Forms]![frmF]![28].Visible = True
[Forms]![frmF]![28].Top = 0

[Forms]![frmF]![29].Enabled = True
[Forms]![frmF]![29].Locked = False
[Forms]![frmF]![29].Visible = True
[Forms]![frmF]![29].Top = 0

[Forms]![frmF]![30].Enabled = True
[Forms]![frmF]![30].Locked = False
[Forms]![frmF]![30].Visible = True
[Forms]![frmF]![30].Top = 0

[Forms]![frmF]![31].Enabled = True
[Forms]![frmF]![31].Locked = False
[Forms]![frmF]![31].Visible = True
[Forms]![frmF]![31].Top = 0

[Forms]![frmF]![32].Enabled = True
[Forms]![frmF]![32].Locked = False
[Forms]![frmF]![32].Visible = True
[Forms]![frmF]![32].Top = 0

[Forms]![frmF]![33].Enabled = True
[Forms]![frmF]![33].Locked = False
[Forms]![frmF]![33].Visible = True
[Forms]![frmF]![33].Top = 0

[Forms]![frmF]![34].Enabled = True
[Forms]![frmF]![34].Locked = False
[Forms]![frmF]![34].Visible = True
[Forms]![frmF]![34].Top = 0

[Forms]![frmF]![35].Enabled = True
[Forms]![frmF]![35].Locked = False
[Forms]![frmF]![35].Visible = True
[Forms]![frmF]![35].Top = 0

[Forms]![frmF]![36].Enabled = True
[Forms]![frmF]![36].Locked = False
[Forms]![frmF]![36].Visible = True
[Forms]![frmF]![36].Top = 0

[Forms]![frmF]![37].Enabled = True
[Forms]![frmF]![37].Locked = False
[Forms]![frmF]![37].Visible = True
[Forms]![frmF]![37].Top = 0

[Forms]![frmF]![38].Enabled = True
[Forms]![frmF]![38].Locked = False
[Forms]![frmF]![38].Visible = True
[Forms]![frmF]![38].Top = 0

[Forms]![frmF]![39].Enabled = True
[Forms]![frmF]![39].Locked = False
[Forms]![frmF]![39].Visible = True
[Forms]![frmF]![39].Top = 0

[Forms]![frmF]![SmQ3].Visible = True
[Forms]![frmF]![SmQ3].Top = 0

Else
[Forms]![frmF]![27].Enabled = False
[Forms]![frmF]![27].Locked = True
[Forms]![frmF]![27].Visible = False

[Forms]![frmF]![28].Enabled = False
[Forms]![frmF]![28].Locked = True
[Forms]![frmF]![28].Visible = False

[Forms]![frmF]![29].Enabled = False
[Forms]![frmF]![29].Locked = True
[Forms]![frmF]![29].Visible = False

[Forms]![frmF]![30].Enabled = False
[Forms]![frmF]![30].Locked = True
[Forms]![frmF]![30].Visible = False

[Forms]![frmF]![31].Enabled = False
[Forms]![frmF]![31].Locked = True
[Forms]![frmF]![31].Visible = False

[Forms]![frmF]![32].Enabled = False
[Forms]![frmF]![32].Locked = True
[Forms]![frmF]![32].Visible = False

[Forms]![frmF]![33].Enabled = False
[Forms]![frmF]![33].Locked = True
[Forms]![frmF]![33].Visible = False

[Forms]![frmF]![34].Enabled = False
[Forms]![frmF]![34].Locked = True
[Forms]![frmF]![34].Visible = False

[Forms]![frmF]![35].Enabled = False
[Forms]![frmF]![35].Locked = True
[Forms]![frmF]![35].Visible = False

[Forms]![frmF]![36].Enabled = False
[Forms]![frmF]![36].Locked = True
[Forms]![frmF]![36].Visible = False

[Forms]![frmF]![37].Enabled = False
[Forms]![frmF]![37].Locked = True
[Forms]![frmF]![37].Visible = False

[Forms]![frmF]![38].Enabled = False
[Forms]![frmF]![38].Locked = True
[Forms]![frmF]![38].Visible = False

[Forms]![frmF]![39].Enabled = False
[Forms]![frmF]![39].Locked = True
[Forms]![frmF]![39].Visible = False

[Forms]![frmF]![SmQ3].Visible = False

End If

If [Forms]![frmF]!optWk = 4 Then
[Forms]![frmF]![40].Enabled = True
[Forms]![frmF]![40].Locked = False
[Forms]![frmF]![40].Visible = True
[Forms]![frmF]![40].Top = 0

[Forms]![frmF]![41].Enabled = True
[Forms]![frmF]![41].Locked = False
[Forms]![frmF]![41].Visible = True
[Forms]![frmF]![41].Top = 0

[Forms]![frmF]![42].Enabled = True
[Forms]![frmF]![42].Locked = False
[Forms]![frmF]![42].Visible = True
[Forms]![frmF]![42].Top = 0

[Forms]![frmF]![43].Enabled = True
[Forms]![frmF]![43].Locked = False
[Forms]![frmF]![43].Visible = True
[Forms]![frmF]![43].Top = 0

[Forms]![frmF]![44].Enabled = True
[Forms]![frmF]![44].Locked = False
[Forms]![frmF]![44].Visible = True
[Forms]![frmF]![44].Top = 0

[Forms]![frmF]![45].Enabled = True
[Forms]![frmF]![45].Locked = False
[Forms]![frmF]![45].Visible = True
[Forms]![frmF]![45].Top = 0

[Forms]![frmF]![46].Enabled = True
[Forms]![frmF]![46].Locked = False
[Forms]![frmF]![46].Visible = True
[Forms]![frmF]![46].Top = 0

[Forms]![frmF]![47].Enabled = True
[Forms]![frmF]![47].Locked = False
[Forms]![frmF]![47].Visible = True
[Forms]![frmF]![47].Top = 0

[Forms]![frmF]![48].Enabled = True
[Forms]![frmF]![48].Locked = False
[Forms]![frmF]![48].Visible = True
[Forms]![frmF]![48].Top = 0

[Forms]![frmF]![49].Enabled = True
[Forms]![frmF]![49].Locked = False
[Forms]![frmF]![49].Visible = True
[Forms]![frmF]![49].Top = 0

[Forms]![frmF]![50].Enabled = True
[Forms]![frmF]![50].Locked = False
[Forms]![frmF]![50].Visible = True
[Forms]![frmF]![50].Top = 0

[Forms]![frmF]![51].Enabled = True
[Forms]![frmF]![51].Locked = False
[Forms]![frmF]![51].Visible = True
[Forms]![frmF]![51].Top = 0

[Forms]![frmF]![52].Enabled = True
[Forms]![frmF]![52].Locked = False
[Forms]![frmF]![52].Visible = True
[Forms]![frmF]![52].Top = 0

[Forms]![frmF]![SmQ4].Visible = True
[Forms]![frmF]![SmQ4].Top = 0

Else
[Forms]![frmF]![40].Enabled = False
[Forms]![frmF]![40].Locked = True
[Forms]![frmF]![40].Visible = False

[Forms]![frmF]![41].Enabled = False
[Forms]![frmF]![41].Locked = True
[Forms]![frmF]![41].Visible = False

[Forms]![frmF]![42].Enabled = False
[Forms]![frmF]![42].Locked = True
[Forms]![frmF]![42].Visible = False

[Forms]![frmF]![43].Enabled = False
[Forms]![frmF]![43].Locked = True
[Forms]![frmF]![43].Visible = False

[Forms]![frmF]![44].Enabled = False
[Forms]![frmF]![44].Locked = True
[Forms]![frmF]![44].Visible = False

[Forms]![frmF]![45].Enabled = False
[Forms]![frmF]![45].Locked = True
[Forms]![frmF]![45].Visible = False

[Forms]![frmF]![46].Enabled = False
[Forms]![frmF]![46].Locked = True
[Forms]![frmF]![46].Visible = False

[Forms]![frmF]![47].Enabled = False
[Forms]![frmF]![47].Locked = True
[Forms]![frmF]![47].Visible = False

[Forms]![frmF]![48].Enabled = False
[Forms]![frmF]![48].Locked = True
[Forms]![frmF]![48].Visible = False

[Forms]![frmF]![49].Enabled = False
[Forms]![frmF]![49].Locked = True
[Forms]![frmF]![49].Visible = False

[Forms]![frmF]![50].Enabled = False
[Forms]![frmF]![50].Locked = True
[Forms]![frmF]![50].Visible = False

[Forms]![frmF]![51].Enabled = False
[Forms]![frmF]![51].Locked = True
[Forms]![frmF]![51].Visible = False

[Forms]![frmF]![52].Enabled = False
[Forms]![frmF]![53].Locked = True
[Forms]![frmF]![52].Visible = False

[Forms]![frmF]![SmQ4].Visible = False
End If

If [Forms]![frmF]!optWk = 5 Then
[Forms]![frmF]![53].Enabled = True
[Forms]![frmF]![53].Locked = False
[Forms]![frmF]![53].Visible = True
[Forms]![frmF]![53].Top = 0

[Forms]![frmF]![54].Enabled = True
[Forms]![frmF]![54].Locked = False
[Forms]![frmF]![54].Visible = True
[Forms]![frmF]![54].Top = 0

[Forms]![frmF]![55].Enabled = True
[Forms]![frmF]![55].Locked = False
[Forms]![frmF]![55].Visible = True
[Forms]![frmF]![55].Top = 0

[Forms]![frmF]![56].Enabled = True
[Forms]![frmF]![56].Locked = False
[Forms]![frmF]![56].Visible = True
[Forms]![frmF]![56].Top = 0

[Forms]![frmF]![57].Enabled = True
[Forms]![frmF]![57].Locked = False
[Forms]![frmF]![57].Visible = True
[Forms]![frmF]![57].Top = 0

[Forms]![frmF]![58].Enabled = True
[Forms]![frmF]![58].Locked = False
[Forms]![frmF]![58].Visible = True
[Forms]![frmF]![58].Top = 0

[Forms]![frmF]![59].Enabled = True
[Forms]![frmF]![59].Locked = False
[Forms]![frmF]![59].Visible = True
[Forms]![frmF]![59].Top = 0

[Forms]![frmF]![60].Enabled = True
[Forms]![frmF]![60].Locked = False
[Forms]![frmF]![60].Visible = True
[Forms]![frmF]![60].Top = 0

[Forms]![frmF]![61].Enabled = True
[Forms]![frmF]![61].Locked = False
[Forms]![frmF]![61].Visible = True
[Forms]![frmF]![61].Top = 0

[Forms]![frmF]![62].Enabled = True
[Forms]![frmF]![62].Locked = False
[Forms]![frmF]![62].Visible = True
[Forms]![frmF]![62].Top = 0

[Forms]![frmF]![63].Enabled = True
[Forms]![frmF]![63].Locked = False
[Forms]![frmF]![63].Visible = True
[Forms]![frmF]![63].Top = 0

[Forms]![frmF]![64].Enabled = True
[Forms]![frmF]![64].Locked = False
[Forms]![frmF]![64].Visible = True
[Forms]![frmF]![64].Top = 0

[Forms]![frmF]![65].Enabled = True
[Forms]![frmF]![65].Locked = False
[Forms]![frmF]![65].Visible = True
[Forms]![frmF]![65].Top = 0

[Forms]![frmF]![SmQ5].Visible = True
[Forms]![frmF]![SmQ5].Top = 0
Else
[Forms]![frmF]![53].Enabled = False
[Forms]![frmF]![53].Locked = True
[Forms]![frmF]![53].Visible = False

[Forms]![frmF]![54].Enabled = False
[Forms]![frmF]![54].Locked = True
[Forms]![frmF]![54].Visible = False

[Forms]![frmF]![55].Enabled = False
[Forms]![frmF]![55].Locked = True
[Forms]![frmF]![55].Visible = False

[Forms]![frmF]![56].Enabled = False
[Forms]![frmF]![56].Locked = True
[Forms]![frmF]![56].Visible = False

[Forms]![frmF]![57].Enabled = False
[Forms]![frmF]![57].Locked = True
[Forms]![frmF]![57].Visible = False

[Forms]![frmF]![58].Enabled = False
[Forms]![frmF]![58].Locked = True
[Forms]![frmF]![58].Visible = False

[Forms]![frmF]![59].Enabled = False
[Forms]![frmF]![59].Locked = True
[Forms]![frmF]![59].Visible = False

[Forms]![frmF]![60].Enabled = False
[Forms]![frmF]![60].Locked = True
[Forms]![frmF]![60].Visible = False

[Forms]![frmF]![61].Enabled = False
[Forms]![frmF]![61].Locked = True
[Forms]![frmF]![61].Visible = False

[Forms]![frmF]![62].Enabled = False
[Forms]![frmF]![62].Locked = True
[Forms]![frmF]![62].Visible = False

[Forms]![frmF]![63].Enabled = False
[Forms]![frmF]![63].Locked = True
[Forms]![frmF]![63].Visible = False

[Forms]![frmF]![64].Enabled = False
[Forms]![frmF]![64].Locked = True
[Forms]![frmF]![64].Visible = False

[Forms]![frmF]![65].Enabled = False
[Forms]![frmF]![65].Locked = True
[Forms]![frmF]![65].Visible = False

[Forms]![frmF]![SmQ5].Visible = False
End If




End Sub
 
In general, that message happens when you adjust the
position (or size) of a control so that it doesn't fit in
its section. Setting the Top property to 0 shouldn't cause
it, but there may be a way. Other than that, I can't see
the problem in all that code, probably because my eyes
glazed over. There is just way too much code to do what
you're trying to do.

Let's try to simplify(?) or at least shorten this procedure.
I'm pretty sure that the first block of nearly identical 5
If statements can be done with something like this air code:

Dim k As Integerk
Dim blk As Integer

If Me!optWk < 1 Or Me!optWk > 5 Then
MsgBox "Option Group has gone off the tracks"
Exit Sub
End If
blk = 13 * (Me!optWk - 1)

For k = 1 To 13
Me("MW" & k) = rs.Fields("L" & blk + k)
Next K

You should remove the db.Close line. You did not open the
db object, so you should not try to close it. Just set it
to Nothing.

The next repetitive If Else blocks can use a similar
approach:

For k = 1 To 13
Me(blk + k).Enabled = Not (Me!DisableThru >= k)
Me(blk + k).Locked = (Me!DisableThru >= k)
Me(blk + k).Visible = (Me!DisableThru >= Me!optWk)
Next k

For k = 1 To 5
Me("SmQ" & k).Visible = (Me!optWk = k)
Next k

That should do it, except that you never explained why you
want to set the Top property of some controls to 0, so I
left that part out.
--
Marsh
MVP [MS Access]



Rob said:
Using AccessXP and a continuous form... I am trying to capture information
for 5 quarters each containing 13 weeks of info... so I have a table with 65
fields(Columns). I have an Option group which upon update essentially
switches which 13 fields are shown in the detail section of the Form.
Incidentally, some fields (columns) are disabled if the time has already
passed...

Some users are experiencing the following error when switching from optWk =
1 to optWk = 2... others are just fine.

The expression After Update you entered as the event property setting
produced the following error: The control or subform command control is too
large for this location.

The code invoked by the option group update is as follows...

What amI be doing wrong ?



Private Sub optWk_AfterUpdate()

Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("qrytblHeaders")

'This section puts the appropriate Month / Week in Header section of the
form

rs.MoveFirst
If [Forms]![frmF]!optWk = 1 Then
[Forms]![frmF]![MW1] = rs!L1
[Forms]![frmF]![MW2] = rs!L2
[Forms]![frmF]![MW3] = rs!L3
[Forms]![frmF]![MW4] = rs!L4
[Forms]![frmF]![MW5] = rs!L5
[Forms]![frmF]![MW6] = rs!L6
[Forms]![frmF]![MW7] = rs!L7
[Forms]![frmF]![MW8] = rs!L8
[Forms]![frmF]![MW9] = rs!L9
[Forms]![frmF]![MW10] = rs!L10
[Forms]![frmF]![MW11] = rs!L11
[Forms]![frmF]![MW12] = rs!L12
[Forms]![frmF]![MW13] = rs!L13
End If
If [Forms]![frmF]!optWk = 2 Then
[Forms]![frmF]![MW1] = rs!L14
[Forms]![frmF]![MW2] = rs!L15
[Forms]![frmF]![MW3] = rs!L16
[Forms]![frmF]![MW4] = rs!L17
[Forms]![frmF]![MW5] = rs!L18
[Forms]![frmF]![MW6] = rs!L19
[Forms]![frmF]![MW7] = rs!L20
[Forms]![frmF]![MW8] = rs!L21
[Forms]![frmF]![MW9] = rs!L22
[Forms]![frmF]![MW10] = rs!L23
[Forms]![frmF]![MW11] = rs!L24
[Forms]![frmF]![MW12] = rs!L25
[Forms]![frmF]![MW13] = rs!L26
End If
If [Forms]![frmF]!optWk = 3 Then
[Forms]![frmF]![MW1] = rs!L27
[Forms]![frmF]![MW2] = rs!L28
[Forms]![frmF]![MW3] = rs!L29
[Forms]![frmF]![MW4] = rs!L30
[Forms]![frmF]![MW5] = rs!L31
[Forms]![frmF]![MW6] = rs!L32
[Forms]![frmF]![MW7] = rs!L33
[Forms]![frmF]![MW8] = rs!L34
[Forms]![frmF]![MW9] = rs!L35
[Forms]![frmF]![MW10] = rs!L36
[Forms]![frmF]![MW11] = rs!L37
[Forms]![frmF]![MW12] = rs!L38
[Forms]![frmF]![MW13] = rs!L39
End If
If [Forms]![frmF]!optWk = 4 Then
[Forms]![frmF]![MW1] = rs!L40
[Forms]![frmF]![MW2] = rs!L41
[Forms]![frmF]![MW3] = rs!L42
[Forms]![frmF]![MW4] = rs!L43
[Forms]![frmF]![MW5] = rs!L44
[Forms]![frmF]![MW6] = rs!L45
[Forms]![frmF]![MW7] = rs!L46
[Forms]![frmF]![MW8] = rs!L47
[Forms]![frmF]![MW9] = rs!L48
[Forms]![frmF]![MW10] = rs!L49
[Forms]![frmF]![MW11] = rs!L50
[Forms]![frmF]![MW12] = rs!L51
[Forms]![frmF]![MW13] = rs!L52
End If
If [Forms]![frmF]!optWk = 5 Then
[Forms]![frmF]![MW1] = rs!L53
[Forms]![frmF]![MW2] = rs!L54
[Forms]![frmF]![MW3] = rs!L55
[Forms]![frmF]![MW4] = rs!L56
[Forms]![frmF]![MW5] = rs!L57
[Forms]![frmF]![MW6] = rs!L58
[Forms]![frmF]![MW7] = rs!L59
[Forms]![frmF]![MW8] = rs!L60
[Forms]![frmF]![MW9] = rs!L61
[Forms]![frmF]![MW10] = rs!L62
[Forms]![frmF]![MW11] = rs!L63
[Forms]![frmF]![MW12] = rs!L64
[Forms]![frmF]![MW13] = rs!L65
End If
[Forms]![frmF].Refresh
rs.Close
Set rs = Nothing

db.Close
Set db = Nothing

If [Forms]![frmF]!optWk = 1 Then
If [Forms]![frmF]![DisableThru] >= 1 Then
[Forms]![frmF]![1].Enabled = False
[Forms]![frmF]![1].Locked = True
Else
[Forms]![frmF]![1].Enabled = True
[Forms]![frmF]![1].Locked = False
End If
[Forms]![frmF]![1].Visible = True
[Forms]![frmF]![1].Top = 0

If [Forms]![frmF]![DisableThru] >= 2 Then
[Forms]![frmF]![2].Enabled = False
[Forms]![frmF]![2].Locked = True
Else
[Forms]![frmF]![2].Enabled = True
[Forms]![frmF]![2].Locked = False
End If
[Forms]![frmF]![2].Visible = True
[Forms]![frmF]![2].Top = 0

If [Forms]![frmF]![DisableThru] >= 3 Then
[Forms]![frmF]![3].Enabled = False
[Forms]![frmF]![3].Locked = True
Else
[Forms]![frmF]![3].Enabled = True
[Forms]![frmF]![3].Locked = False
End If
[Forms]![frmF]![3].Visible = True
[Forms]![frmF]![3].Top = 0

If [Forms]![frmF]![DisableThru] >= 4 Then
[Forms]![frmF]![4].Enabled = False
[Forms]![frmF]![4].Locked = True
Else
[Forms]![frmF]![4].Enabled = True
[Forms]![frmF]![4].Locked = False
End If
[Forms]![frmF]![4].Visible = True
[Forms]![frmF]![4].Top = 0

If [Forms]![frmF]![DisableThru] >= 5 Then
[Forms]![frmF]![5].Enabled = False
[Forms]![frmF]![5].Locked = True
Else
[Forms]![frmF]![5].Enabled = True
[Forms]![frmF]![5].Locked = False
End If
[Forms]![frmF]![5].Visible = True
[Forms]![frmF]![5].Top = 0

If [Forms]![frmF]![DisableThru] >= 6 Then
[Forms]![frmF]![6].Enabled = False
[Forms]![frmF]![6].Locked = True
Else
[Forms]![frmF]![6].Enabled = True
[Forms]![frmF]![6].Locked = False
End If
[Forms]![frmF]![6].Visible = True
[Forms]![frmF]![6].Top = 0

If [Forms]![frmF]![DisableThru] >= 7 Then
[Forms]![frmF]![7].Enabled = False
[Forms]![frmF]![7].Locked = True
Else
[Forms]![frmF]![7].Enabled = True
[Forms]![frmF]![7].Locked = False
End If
[Forms]![frmF]![7].Visible = True
[Forms]![frmF]![7].Top = 0

If [Forms]![frmF]![DisableThru] >= 8 Then
[Forms]![frmF]![8].Enabled = False
[Forms]![frmF]![8].Locked = True
Else
[Forms]![frmF]![8].Enabled = True
[Forms]![frmF]![8].Locked = False
End If
[Forms]![frmF]![8].Visible = True
[Forms]![frmF]![8].Top = 0

If [Forms]![frmF]![DisableThru] >= 9 Then
[Forms]![frmF]![9].Enabled = False
[Forms]![frmF]![9].Locked = True
Else
[Forms]![frmF]![9].Enabled = True
[Forms]![frmF]![9].Locked = False
End If
[Forms]![frmF]![9].Visible = True
[Forms]![frmF]![9].Top = 0

If [Forms]![frmF]![DisableThru] >= 10 Then
[Forms]![frmF]![10].Enabled = False
[Forms]![frmF]![10].Locked = True
Else
[Forms]![frmF]![10].Enabled = True
[Forms]![frmF]![10].Locked = False
End If
[Forms]![frmF]![10].Visible = True
[Forms]![frmF]![10].Top = 0

If [Forms]![frmF]![DisableThru] >= 11 Then
[Forms]![frmF]![11].Enabled = False
[Forms]![frmF]![11].Locked = True
Else
[Forms]![frmF]![11].Enabled = True
[Forms]![frmF]![11].Locked = False
End If
[Forms]![frmF]![11].Visible = True
[Forms]![frmF]![11].Top = 0

If [Forms]![frmF]![DisableThru] >= 12 Then
[Forms]![frmF]![12].Enabled = False
[Forms]![frmF]![12].Locked = True
Else
[Forms]![frmF]![12].Enabled = True
[Forms]![frmF]![12].Locked = False
End If
[Forms]![frmF]![12].Visible = True
[Forms]![frmF]![12].Top = 0

If [Forms]![frmF]![DisableThru] >= 13 Then
[Forms]![frmF]![13].Enabled = False
[Forms]![frmF]![13].Locked = True
Else
[Forms]![frmF]![13].Enabled = True
[Forms]![frmF]![13].Locked = False
End If
[Forms]![frmF]![13].Visible = True
[Forms]![frmF]![13].Top = 0

[Forms]![frmF]![SmQ1].Visible = True
[Forms]![frmF]![SmQ1].Top = 0

Else
[Forms]![frmF]![1].Enabled = False
[Forms]![frmF]![1].Locked = True
[Forms]![frmF]![1].Visible = False

[Forms]![frmF]![2].Enabled = False
[Forms]![frmF]![2].Locked = True
[Forms]![frmF]![2].Visible = False

[Forms]![frmF]![3].Enabled = False
[Forms]![frmF]![3].Locked = True
[Forms]![frmF]![3].Visible = False

[Forms]![frmF]![4].Enabled = False
[Forms]![frmF]![4].Locked = True
[Forms]![frmF]![4].Visible = False

[Forms]![frmF]![5].Enabled = False
[Forms]![frmF]![5].Locked = True
[Forms]![frmF]![5].Visible = False

[Forms]![frmF]![6].Enabled = False
[Forms]![frmF]![6].Locked = True
[Forms]![frmF]![6].Visible = False

[Forms]![frmF]![7].Enabled = False
[Forms]![frmF]![7].Locked = True
[Forms]![frmF]![7].Visible = False

[Forms]![frmF]![8].Enabled = False
[Forms]![frmF]![8].Locked = True
[Forms]![frmF]![8].Visible = False

[Forms]![frmF]![9].Enabled = False
[Forms]![frmF]![9].Locked = True
[Forms]![frmF]![9].Visible = False

[Forms]![frmF]![10].Enabled = False
[Forms]![frmF]![10].Locked = True
[Forms]![frmF]![10].Visible = False

[Forms]![frmF]![11].Enabled = False
[Forms]![frmF]![11].Locked = True
[Forms]![frmF]![11].Visible = False

[Forms]![frmF]![12].Enabled = False
[Forms]![frmF]![12].Locked = True
[Forms]![frmF]![12].Visible = False

[Forms]![frmF]![13].Enabled = False
[Forms]![frmF]![13].Locked = True
[Forms]![frmF]![13].Visible = False

[Forms]![frmF]![SmQ1].Visible = False

End If

If [Forms]![frmF]!optWk = 2 Then
[Forms]![frmF]![14].Enabled = True
[Forms]![frmF]![14].Locked = False
[Forms]![frmF]![14].Visible = True
[Forms]![frmF]![14].Top = 0

[Forms]![frmF]![15].Enabled = True
[Forms]![frmF]![15].Locked = False
[Forms]![frmF]![15].Visible = True
[Forms]![frmF]![15].Top = 0

[Forms]![frmF]![16].Enabled = True
[Forms]![frmF]![16].Locked = False
[Forms]![frmF]![16].Visible = True
[Forms]![frmF]![16].Top = 0

[Forms]![frmF]![17].Enabled = True
[Forms]![frmF]![17].Locked = False
[Forms]![frmF]![17].Visible = True
[Forms]![frmF]![17].Top = 0

[Forms]![frmF]![18].Enabled = True
[Forms]![frmF]![18].Locked = False
[Forms]![frmF]![18].Visible = True
[Forms]![frmF]![18].Top = 0

[Forms]![frmF]![19].Enabled = True
[Forms]![frmF]![19].Locked = False
[Forms]![frmF]![19].Visible = True
[Forms]![frmF]![19].Top = 0

[Forms]![frmF]![20].Enabled = True
[Forms]![frmF]![20].Locked = False
[Forms]![frmF]![20].Visible = True
[Forms]![frmF]![20].Top = 0

[Forms]![frmF]![21].Enabled = True
[Forms]![frmF]![21].Locked = False
[Forms]![frmF]![21].Visible = True
[Forms]![frmF]![21].Top = 0

[Forms]![frmF]![22].Enabled = True
[Forms]![frmF]![22].Locked = False
[Forms]![frmF]![22].Visible = True
[Forms]![frmF]![22].Top = 0

[Forms]![frmF]![23].Enabled = True
[Forms]![frmF]![23].Locked = False
[Forms]![frmF]![23].Visible = True
[Forms]![frmF]![23].Top = 0

[Forms]![frmF]![24].Enabled = True
[Forms]![frmF]![24].Locked = False
[Forms]![frmF]![24].Visible = True
[Forms]![frmF]![24].Top = 0

[Forms]![frmF]![25].Enabled = True
[Forms]![frmF]![25].Locked = False
[Forms]![frmF]![25].Visible = True
[Forms]![frmF]![25].Top = 0

[Forms]![frmF]![26].Enabled = True
[Forms]![frmF]![26].Locked = False
[Forms]![frmF]![26].Visible = True
[Forms]![frmF]![26].Top = 0

[Forms]![frmF]![SmQ2].Visible = True
[Forms]![frmF]![SmQ2].Top = 0

Else
[Forms]![frmF]![14].Enabled = False
[Forms]![frmF]![14].Locked = True
[Forms]![frmF]![14].Visible = False

[Forms]![frmF]![15].Enabled = False
[Forms]![frmF]![15].Locked = True
[Forms]![frmF]![15].Visible = False

[Forms]![frmF]![16].Enabled = False
[Forms]![frmF]![16].Locked = True
[Forms]![frmF]![16].Visible = False

[Forms]![frmF]![17].Enabled = False
[Forms]![frmF]![17].Locked = True
[Forms]![frmF]![17].Visible = False

[Forms]![frmF]![18].Enabled = False
[Forms]![frmF]![18].Locked = True
[Forms]![frmF]![18].Visible = False

[Forms]![frmF]![19].Enabled = False
[Forms]![frmF]![19].Locked = True
[Forms]![frmF]![19].Visible = False

[Forms]![frmF]![20].Enabled = False
[Forms]![frmF]![20].Locked = True
[Forms]![frmF]![20].Visible = False

[Forms]![frmF]![21].Enabled = False
[Forms]![frmF]![21].Locked = True
[Forms]![frmF]![21].Visible = False

[Forms]![frmF]![22].Enabled = False
[Forms]![frmF]![22].Locked = True
[Forms]![frmF]![22].Visible = False

[Forms]![frmF]![23].Enabled = False
[Forms]![frmF]![23].Locked = True
[Forms]![frmF]![23].Visible = False

[Forms]![frmF]![24].Enabled = False
[Forms]![frmF]![24].Locked = True
[Forms]![frmF]![24].Visible = False

[Forms]![frmF]![25].Enabled = False
[Forms]![frmF]![25].Locked = True
[Forms]![frmF]![25].Visible = False

[Forms]![frmF]![26].Enabled = False
[Forms]![frmF]![26].Locked = True
[Forms]![frmF]![26].Visible = False

[Forms]![frmF]![SmQ2].Visible = False

End If

If [Forms]![frmF]!optWk = 3 Then
[Forms]![frmF]![27].Enabled = True
[Forms]![frmF]![27].Locked = False
[Forms]![frmF]![27].Visible = True
[Forms]![frmF]![27].Top = 0

[Forms]![frmF]![28].Enabled = True
[Forms]![frmF]![28].Locked = False
[Forms]![frmF]![28].Visible = True
[Forms]![frmF]![28].Top = 0

[Forms]![frmF]![29].Enabled = True
[Forms]![frmF]![29].Locked = False
[Forms]![frmF]![29].Visible = True
[Forms]![frmF]![29].Top = 0

[Forms]![frmF]![30].Enabled = True
[Forms]![frmF]![30].Locked = False
[Forms]![frmF]![30].Visible = True
[Forms]![frmF]![30].Top = 0

[Forms]![frmF]![31].Enabled = True
[Forms]![frmF]![31].Locked = False
[Forms]![frmF]![31].Visible = True
[Forms]![frmF]![31].Top = 0

[Forms]![frmF]![32].Enabled = True
[Forms]![frmF]![32].Locked = False
[Forms]![frmF]![32].Visible = True
[Forms]![frmF]![32].Top = 0

[Forms]![frmF]![33].Enabled = True
[Forms]![frmF]![33].Locked = False
[Forms]![frmF]![33].Visible = True
[Forms]![frmF]![33].Top = 0

[Forms]![frmF]![34].Enabled = True
[Forms]![frmF]![34].Locked = False
[Forms]![frmF]![34].Visible = True
[Forms]![frmF]![34].Top = 0

[Forms]![frmF]![35].Enabled = True
[Forms]![frmF]![35].Locked = False
[Forms]![frmF]![35].Visible = True
[Forms]![frmF]![35].Top = 0

[Forms]![frmF]![36].Enabled = True
[Forms]![frmF]![36].Locked = False
[Forms]![frmF]![36].Visible = True
[Forms]![frmF]![36].Top = 0

[Forms]![frmF]![37].Enabled = True
[Forms]![frmF]![37].Locked = False
[Forms]![frmF]![37].Visible = True
[Forms]![frmF]![37].Top = 0

[Forms]![frmF]![38].Enabled = True
[Forms]![frmF]![38].Locked = False
[Forms]![frmF]![38].Visible = True
[Forms]![frmF]![38].Top = 0

[Forms]![frmF]![39].Enabled = True
[Forms]![frmF]![39].Locked = False
[Forms]![frmF]![39].Visible = True
[Forms]![frmF]![39].Top = 0

[Forms]![frmF]![SmQ3].Visible = True
[Forms]![frmF]![SmQ3].Top = 0

Else
[Forms]![frmF]![27].Enabled = False
[Forms]![frmF]![27].Locked = True
[Forms]![frmF]![27].Visible = False

[Forms]![frmF]![28].Enabled = False
[Forms]![frmF]![28].Locked = True
[Forms]![frmF]![28].Visible = False

[Forms]![frmF]![29].Enabled = False
[Forms]![frmF]![29].Locked = True
[Forms]![frmF]![29].Visible = False

[Forms]![frmF]![30].Enabled = False
[Forms]![frmF]![30].Locked = True
[Forms]![frmF]![30].Visible = False

[Forms]![frmF]![31].Enabled = False
[Forms]![frmF]![31].Locked = True
[Forms]![frmF]![31].Visible = False

[Forms]![frmF]![32].Enabled = False
[Forms]![frmF]![32].Locked = True
[Forms]![frmF]![32].Visible = False

[Forms]![frmF]![33].Enabled = False
[Forms]![frmF]![33].Locked = True
[Forms]![frmF]![33].Visible = False

[Forms]![frmF]![34].Enabled = False
[Forms]![frmF]![34].Locked = True
[Forms]![frmF]![34].Visible = False

[Forms]![frmF]![35].Enabled = False
[Forms]![frmF]![35].Locked = True
[Forms]![frmF]![35].Visible = False

[Forms]![frmF]![36].Enabled = False
[Forms]![frmF]![36].Locked = True
[Forms]![frmF]![36].Visible = False

[Forms]![frmF]![37].Enabled = False
[Forms]![frmF]![37].Locked = True
[Forms]![frmF]![37].Visible = False

[Forms]![frmF]![38].Enabled = False
[Forms]![frmF]![38].Locked = True
[Forms]![frmF]![38].Visible = False

[Forms]![frmF]![39].Enabled = False
[Forms]![frmF]![39].Locked = True
[Forms]![frmF]![39].Visible = False

[Forms]![frmF]![SmQ3].Visible = False

End If

If [Forms]![frmF]!optWk = 4 Then
[Forms]![frmF]![40].Enabled = True
[Forms]![frmF]![40].Locked = False
[Forms]![frmF]![40].Visible = True
[Forms]![frmF]![40].Top = 0

[Forms]![frmF]![41].Enabled = True
[Forms]![frmF]![41].Locked = False
[Forms]![frmF]![41].Visible = True
[Forms]![frmF]![41].Top = 0

[Forms]![frmF]![42].Enabled = True
[Forms]![frmF]![42].Locked = False
[Forms]![frmF]![42].Visible = True
[Forms]![frmF]![42].Top = 0

[Forms]![frmF]![43].Enabled = True
[Forms]![frmF]![43].Locked = False
[Forms]![frmF]![43].Visible = True
[Forms]![frmF]![43].Top = 0

[Forms]![frmF]![44].Enabled = True
[Forms]![frmF]![44].Locked = False
[Forms]![frmF]![44].Visible = True
[Forms]![frmF]![44].Top = 0

[Forms]![frmF]![45].Enabled = True
[Forms]![frmF]![45].Locked = False
[Forms]![frmF]![45].Visible = True
[Forms]![frmF]![45].Top = 0

[Forms]![frmF]![46].Enabled = True
[Forms]![frmF]![46].Locked = False
[Forms]![frmF]![46].Visible = True
[Forms]![frmF]![46].Top = 0

[Forms]![frmF]![47].Enabled = True
[Forms]![frmF]![47].Locked = False
[Forms]![frmF]![47].Visible = True
[Forms]![frmF]![47].Top = 0

[Forms]![frmF]![48].Enabled = True
[Forms]![frmF]![48].Locked = False
[Forms]![frmF]![48].Visible = True
[Forms]![frmF]![48].Top = 0

[Forms]![frmF]![49].Enabled = True
[Forms]![frmF]![49].Locked = False
[Forms]![frmF]![49].Visible = True
[Forms]![frmF]![49].Top = 0

[Forms]![frmF]![50].Enabled = True
[Forms]![frmF]![50].Locked = False
[Forms]![frmF]![50].Visible = True
[Forms]![frmF]![50].Top = 0

[Forms]![frmF]![51].Enabled = True
[Forms]![frmF]![51].Locked = False
[Forms]![frmF]![51].Visible = True
[Forms]![frmF]![51].Top = 0

[Forms]![frmF]![52].Enabled = True
[Forms]![frmF]![52].Locked = False
[Forms]![frmF]![52].Visible = True
[Forms]![frmF]![52].Top = 0

[Forms]![frmF]![SmQ4].Visible = True
[Forms]![frmF]![SmQ4].Top = 0

Else
[Forms]![frmF]![40].Enabled = False
[Forms]![frmF]![40].Locked = True
[Forms]![frmF]![40].Visible = False

[Forms]![frmF]![41].Enabled = False
[Forms]![frmF]![41].Locked = True
[Forms]![frmF]![41].Visible = False

[Forms]![frmF]![42].Enabled = False
[Forms]![frmF]![42].Locked = True
[Forms]![frmF]![42].Visible = False

[Forms]![frmF]![43].Enabled = False
[Forms]![frmF]![43].Locked = True
[Forms]![frmF]![43].Visible = False

[Forms]![frmF]![44].Enabled = False
[Forms]![frmF]![44].Locked = True
[Forms]![frmF]![44].Visible = False

[Forms]![frmF]![45].Enabled = False
[Forms]![frmF]![45].Locked = True
[Forms]![frmF]![45].Visible = False

[Forms]![frmF]![46].Enabled = False
[Forms]![frmF]![46].Locked = True
[Forms]![frmF]![46].Visible = False

[Forms]![frmF]![47].Enabled = False
[Forms]![frmF]![47].Locked = True
[Forms]![frmF]![47].Visible = False

[Forms]![frmF]![48].Enabled = False
[Forms]![frmF]![48].Locked = True
[Forms]![frmF]![48].Visible = False

[Forms]![frmF]![49].Enabled = False
[Forms]![frmF]![49].Locked = True
[Forms]![frmF]![49].Visible = False

[Forms]![frmF]![50].Enabled = False
[Forms]![frmF]![50].Locked = True
[Forms]![frmF]![50].Visible = False

[Forms]![frmF]![51].Enabled = False
[Forms]![frmF]![51].Locked = True
[Forms]![frmF]![51].Visible = False

[Forms]![frmF]![52].Enabled = False
[Forms]![frmF]![53].Locked = True
[Forms]![frmF]![52].Visible = False

[Forms]![frmF]![SmQ4].Visible = False
End If

If [Forms]![frmF]!optWk = 5 Then
[Forms]![frmF]![53].Enabled = True
[Forms]![frmF]![53].Locked = False
[Forms]![frmF]![53].Visible = True
[Forms]![frmF]![53].Top = 0

[Forms]![frmF]![54].Enabled = True
[Forms]![frmF]![54].Locked = False
[Forms]![frmF]![54].Visible = True
[Forms]![frmF]![54].Top = 0

[Forms]![frmF]![55].Enabled = True
[Forms]![frmF]![55].Locked = False
[Forms]![frmF]![55].Visible = True
[Forms]![frmF]![55].Top = 0

[Forms]![frmF]![56].Enabled = True
[Forms]![frmF]![56].Locked = False
[Forms]![frmF]![56].Visible = True
[Forms]![frmF]![56].Top = 0

[Forms]![frmF]![57].Enabled = True
[Forms]![frmF]![57].Locked = False
[Forms]![frmF]![57].Visible = True
[Forms]![frmF]![57].Top = 0

[Forms]![frmF]![58].Enabled = True
[Forms]![frmF]![58].Locked = False
[Forms]![frmF]![58].Visible = True
[Forms]![frmF]![58].Top = 0

[Forms]![frmF]![59].Enabled = True
[Forms]![frmF]![59].Locked = False
[Forms]![frmF]![59].Visible = True
[Forms]![frmF]![59].Top = 0

[Forms]![frmF]![60].Enabled = True
[Forms]![frmF]![60].Locked = False
[Forms]![frmF]![60].Visible = True
[Forms]![frmF]![60].Top = 0

[Forms]![frmF]![61].Enabled = True
[Forms]![frmF]![61].Locked = False
[Forms]![frmF]![61].Visible = True
[Forms]![frmF]![61].Top = 0

[Forms]![frmF]![62].Enabled = True
[Forms]![frmF]![62].Locked = False
[Forms]![frmF]![62].Visible = True
[Forms]![frmF]![62].Top = 0

[Forms]![frmF]![63].Enabled = True
[Forms]![frmF]![63].Locked = False
[Forms]![frmF]![63].Visible = True
[Forms]![frmF]![63].Top = 0

[Forms]![frmF]![64].Enabled = True
[Forms]![frmF]![64].Locked = False
[Forms]![frmF]![64].Visible = True
[Forms]![frmF]![64].Top = 0

[Forms]![frmF]![65].Enabled = True
[Forms]![frmF]![65].Locked = False
[Forms]![frmF]![65].Visible = True
[Forms]![frmF]![65].Top = 0

[Forms]![frmF]![SmQ5].Visible = True
[Forms]![frmF]![SmQ5].Top = 0
Else
[Forms]![frmF]![53].Enabled = False
[Forms]![frmF]![53].Locked = True
[Forms]![frmF]![53].Visible = False

[Forms]![frmF]![54].Enabled = False
[Forms]![frmF]![54].Locked = True
[Forms]![frmF]![54].Visible = False

[Forms]![frmF]![55].Enabled = False
[Forms]![frmF]![55].Locked = True
[Forms]![frmF]![55].Visible = False

[Forms]![frmF]![56].Enabled = False
[Forms]![frmF]![56].Locked = True
[Forms]![frmF]![56].Visible = False

[Forms]![frmF]![57].Enabled = False
[Forms]![frmF]![57].Locked = True
[Forms]![frmF]![57].Visible = False

[Forms]![frmF]![58].Enabled = False
[Forms]![frmF]![58].Locked = True
[Forms]![frmF]![58].Visible = False

[Forms]![frmF]![59].Enabled = False
[Forms]![frmF]![59].Locked = True
[Forms]![frmF]![59].Visible = False

[Forms]![frmF]![60].Enabled = False
[Forms]![frmF]![60].Locked = True
[Forms]![frmF]![60].Visible = False

[Forms]![frmF]![61].Enabled = False
[Forms]![frmF]![61].Locked = True
[Forms]![frmF]![61].Visible = False

[Forms]![frmF]![62].Enabled = False
[Forms]![frmF]![62].Locked = True
[Forms]![frmF]![62].Visible = False

[Forms]![frmF]![63].Enabled = False
[Forms]![frmF]![63].Locked = True
[Forms]![frmF]![63].Visible = False

[Forms]![frmF]![64].Enabled = False
[Forms]![frmF]![64].Locked = True
[Forms]![frmF]![64].Visible = False

[Forms]![frmF]![65].Enabled = False
[Forms]![frmF]![65].Locked = True
[Forms]![frmF]![65].Visible = False

[Forms]![frmF]![SmQ5].Visible = False
End If




End Sub
 
Rob C wrote:
As long as it doesn't get in the way , I guess setting Top
to 0 will take care of that.

So did you ever solve the original problem about the error
message?
--
Marsh
MVP [MS Access]

Thanks for the help Marshall,

Reason for Top =0... since I have 65 text boxes in the detail (only 13 of
which are visible at one time)... I chose not to put them on top of each
other.... instead they are lined up in design view in 5 rows...




"Marshall Barton" wrote
[snip]
 
No, have not solved that one yet.... maybe the Top = 0 is too close to the
border... maybe I should widen the detail section... don't really know...
one common theme though.... it appears that the users that get the error
happen to be working over a VPN as opposed to being directly connected at
the office.

Thanks again


Marshall Barton said:
Rob C wrote:
As long as it doesn't get in the way , I guess setting Top
to 0 will take care of that.

So did you ever solve the original problem about the error
message?
--
Marsh
MVP [MS Access]

Thanks for the help Marshall,

Reason for Top =0... since I have 65 text boxes in the detail (only 13 of
which are visible at one time)... I chose not to put them on top of each
other.... instead they are lined up in design view in 5 rows...




"Marshall Barton" wrote
[snip]
 
As an experiment, try making the detail taller. There may
be some rounding issues with some screen driver and/or
monitor resolutions???

If you're getting a Debug option on the error message, what
line of code does it say had the problem. If that doesn't
give you some clues, and assuming you can trigger the
problem in a controled situation, try setting some
strategically placed breakpoints.

It's always a bear when you can't reproduce a problem on
your test system :-(

Good luck,
--
Marsh
MVP [MS Access]


Rob said:
No, have not solved that one yet.... maybe the Top = 0 is too close to the
border... maybe I should widen the detail section... don't really know...
one common theme though.... it appears that the users that get the error
happen to be working over a VPN as opposed to being directly connected at
the office.


As long as it doesn't get in the way , I guess setting Top
to 0 will take care of that.

So did you ever solve the original problem about the error
message?

Thanks for the help Marshall,
Reason for Top =0... since I have 65 text boxes in the detail (only 13 of
which are visible at one time)... I chose not to put them on top of each
other.... instead they are lined up in design view in 5 rows...


In general, that message happens when you adjust the
position (or size) of a control so that it doesn't fit in
its section. Setting the Top property to 0 shouldn't cause
it, but there may be a way. Other than that, I can't see
the problem in all that code, probably because my eyes
glazed over. There is just way too much code to do what
you're trying to do.

Let's try to simplify(?) or at least shorten this procedure.
I'm pretty sure that the first block of nearly identical 5
If statements can be done with something like this air code:

Dim k As Integerk
Dim blk As Integer

If Me!optWk < 1 Or Me!optWk > 5 Then
MsgBox "Option Group has gone off the tracks"
Exit Sub
End If
blk = 13 * (Me!optWk - 1)

For k = 1 To 13
Me("MW" & k) = rs.Fields("L" & blk + k)
Next K

You should remove the db.Close line. You did not open the
db object, so you should not try to close it. Just set it
to Nothing.

The next repetitive If Else blocks can use a similar
approach:

For k = 1 To 13
Me(blk + k).Enabled = Not (Me!DisableThru >= k)
Me(blk + k).Locked = (Me!DisableThru >= k)
Me(blk + k).Visible = (Me!DisableThru >= Me!optWk)
Next k

For k = 1 To 5
Me("SmQ" & k).Visible = (Me!optWk = k)
Next k

That should do it, except that you never explained why you
want to set the Top property of some controls to 0, so I
left that part out.


Rob C wrote:

Using AccessXP and a continuous form... I am trying to capture
information
for 5 quarters each containing 13 weeks of info... so I have a table
with
65
fields(Columns). I have an Option group which upon update essentially
switches which 13 fields are shown in the detail section of the Form.
Incidentally, some fields (columns) are disabled if the time has already
passed...

Some users are experiencing the following error when switching from
optWk
=
1 to optWk = 2... others are just fine.

The expression After Update you entered as the event property setting
produced the following error: The control or subform command control is
too
large for this location.

The code invoked by the option group update is as follows...
[snip]
 
Back
Top