B
Bill
Three forms, a parent, "DirectoryItems" and two
sub-forms, "FamDirItems" and "PermissionBoxes".
When ANY of the controls in "FamDirItems" get
the focus, Sub ShiftPB (code below) is called to
change the vertical location of the 2nd sub-form
and its filter expression.
However, the resulting sub-form becomes empty.
When I run essentially the identical code in the
code-sheet of the sub-form with a series of
values, entered via InputBox, as substitutes
for Me.FamilyID the form displays according
to the value I entered and perfect in every way.
Is there something in Access that gets messed up
when one sub-form attempts to alter the filter
properties of another sub-form?
The RecordSource of the failing sub-form is
quite simple in that it only returns 7 or 8 fields
from a single table.
One very perplexing observation occurs when the
first record in the 1st sub-form, "FamDirItems" is
chosen in that the 2nd sub-form "PermissionBoxes"
displays the correct values, but in all other cases
it displays empty.
Private Sub ShiftPB()
Dim strFilter As String
'================================================
' All detectable controls (see below) call here to shift the "Permissions
' Check-Boxes" to correspond positionally with the current family record.
'================================================
Forms!DirectoryItems!PermissionBoxes.Top = Me.CurrentSectionTop
strFilter = "[FamilyID] = " & Me.FamilyID & _
" AND ([RegAs] = ""Hd of Hsehold"" OR [RegAs] = ""Spouse"") "
Forms!DirectoryItems!PermissionBoxes.Form.Filter = strFilter
Forms!DirectoryItems!PermissionBoxes.Form.FilterOn = True
Forms!DirectoryItems!PermissionBoxes.Form.Requery
End Sub
sub-forms, "FamDirItems" and "PermissionBoxes".
When ANY of the controls in "FamDirItems" get
the focus, Sub ShiftPB (code below) is called to
change the vertical location of the 2nd sub-form
and its filter expression.
However, the resulting sub-form becomes empty.
When I run essentially the identical code in the
code-sheet of the sub-form with a series of
values, entered via InputBox, as substitutes
for Me.FamilyID the form displays according
to the value I entered and perfect in every way.
Is there something in Access that gets messed up
when one sub-form attempts to alter the filter
properties of another sub-form?
The RecordSource of the failing sub-form is
quite simple in that it only returns 7 or 8 fields
from a single table.
One very perplexing observation occurs when the
first record in the 1st sub-form, "FamDirItems" is
chosen in that the 2nd sub-form "PermissionBoxes"
displays the correct values, but in all other cases
it displays empty.
Private Sub ShiftPB()
Dim strFilter As String
'================================================
' All detectable controls (see below) call here to shift the "Permissions
' Check-Boxes" to correspond positionally with the current family record.
'================================================
Forms!DirectoryItems!PermissionBoxes.Top = Me.CurrentSectionTop
strFilter = "[FamilyID] = " & Me.FamilyID & _
" AND ([RegAs] = ""Hd of Hsehold"" OR [RegAs] = ""Spouse"") "
Forms!DirectoryItems!PermissionBoxes.Form.Filter = strFilter
Forms!DirectoryItems!PermissionBoxes.Form.FilterOn = True
Forms!DirectoryItems!PermissionBoxes.Form.Requery
End Sub