Requery subform doesn't display all records

K

kbremner

I'm trying to pick a list of names to display on a subform. The list
of names in sfrmProspectsMailingListSubform1 has a list of names and
each record has a true/false checkbox named Print. The following code
is in the AfterUpdate event for the print checkbox. When a user puts a
check for a record, it is supposed to requery ...subform2. What
happens, however, is when you click the first checkbox, nothing
happens. When you click the second checkbox, the first name appears in
subform2, check the third box and the second name appears in subform2
and so on. Also, let say you click name one and then name two so
subform now displays only name one. Then you click on name two again
so it is unchecked, it will now appear in subform2. Then click on name
three and only name one will appear in subform2. I have checked the
table where the data is coming from and the expected records are
checked off, but they don't display in the subform. Any ideas what is
going on here??

Private Sub Print_AfterUpdate()
On Error GoTo Err_Print_AfterUpdate

Me.Parent.sfrmProspectsMailingListSubform2.Requery

Exit_Print_AfterUpdate:
Exit Sub

Err_Print_AfterUpdate:
MsgBox "(Print_AfterUpdate) " & Err.Number & ": " &
Err.Description
Resume Exit_Print_AfterUpdate

End Sub
 
K

kbremner

I'm trying to pick a list of names to display on a subform. The list
of names in sfrmProspectsMailingListSubform1 has a list of names and
each record has a true/false checkbox named Print. The following code
is in the AfterUpdate event for the print checkbox. When a user puts a
check for a record, it is supposed to requery ...subform2. What
happens, however, is when you click the first checkbox, nothing
happens. When you click the second checkbox, the first name appears in
subform2, check the third box and the second name appears in subform2
and so on. Also, let say you click name one and then name two so
subform now displays only name one. Then you click on name two again
so it is unchecked, it will now appear in subform2. Then click on name
three and only name one will appear in subform2. I have checked the
table where the data is coming from and the expected records are
checked off, but they don't display in the subform. Any ideas what is
going on here??

Private Sub Print_AfterUpdate()
On Error GoTo Err_Print_AfterUpdate

    Me.Parent.sfrmProspectsMailingListSubform2.Requery

Exit_Print_AfterUpdate:
    Exit Sub

Err_Print_AfterUpdate:
    MsgBox "(Print_AfterUpdate) " & Err.Number & ": " &
Err.Description
    Resume Exit_Print_AfterUpdate

End Sub

I didn't exactly answer my question, but did find an alternative. I
changed Me.Parent.sfrmProspectsMailingListSubform2.Requery to
Me.Parent.Refresh and all works well now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top