G
Guest
I have found a sample database for recurring items built by Duane Hookom. I
have successfully modified it to my needs. On a form, you can choose (with an
option button) whether the item repeats or not. If it repeats, you see
several check boxes to choose your pattern of days. If non-repeating, the
check boxes (and corresponding labels) are hidden and you see a subfrom
appear in their place to enter your individual dates. But, my problem is that
I can hide all the check boxes (ckday in code below) but not the
corresponding labels (the days of the week) as the sample database does. My
code that makes this part of the DB work is below:
Dim ctl As Control
Dim intCounter As Integer
Dim intWeek As Integer
Dim intDay As Integer
Me.txtEndDate.Visible = (Me.grpRepeats = 2)
Me.txtStartDate.Visible = (Me.grpRepeats = 2)
Me.sfrmTempSched.Visible = (Me.grpRepeats = 1)
For intWeek = 0 To 5
For intDay = 1 To 7
Set ctl = Me("chkDay" & intWeek & intDay)
ctl.Visible = (Me.grpRepeats = 2)
ctl.Value = 0
Next
Next
Select Case Me.grpRepeats
Case 2 'repeating
Case 1
End Select
End Sub
My code should be exact from the sample as I have stared at it for hours.
Sample works, mine does not. What could I be missing?
Thanks for any help.
have successfully modified it to my needs. On a form, you can choose (with an
option button) whether the item repeats or not. If it repeats, you see
several check boxes to choose your pattern of days. If non-repeating, the
check boxes (and corresponding labels) are hidden and you see a subfrom
appear in their place to enter your individual dates. But, my problem is that
I can hide all the check boxes (ckday in code below) but not the
corresponding labels (the days of the week) as the sample database does. My
code that makes this part of the DB work is below:
Dim ctl As Control
Dim intCounter As Integer
Dim intWeek As Integer
Dim intDay As Integer
Me.txtEndDate.Visible = (Me.grpRepeats = 2)
Me.txtStartDate.Visible = (Me.grpRepeats = 2)
Me.sfrmTempSched.Visible = (Me.grpRepeats = 1)
For intWeek = 0 To 5
For intDay = 1 To 7
Set ctl = Me("chkDay" & intWeek & intDay)
ctl.Visible = (Me.grpRepeats = 2)
ctl.Value = 0
Next
Next
Select Case Me.grpRepeats
Case 2 'repeating
Case 1
End Select
End Sub
My code should be exact from the sample as I have stared at it for hours.
Sample works, mine does not. What could I be missing?
Thanks for any help.