How Force Subform Requery?

  • Thread starter Thread starter David Habercom
  • Start date Start date
D

David Habercom

I have a bound subform for which I would like to force a requery after I
click in a Yes\No checkbox. How do I do this? I've tried Before &
AfterUpdate, Click, and the usual suspects. Obviously I am missing
something.

Thanks.

David
 
Try to Dim the subform:


Dim sbfrm as Subform
sbfrm = me.mysubform


sbfrm.Requery
 
David said:
I have a bound subform for which I would like to force a requery after I
click in a Yes\No checkbox. How do I do this? I've tried Before &
AfterUpdate, Click, and the usual suspects. Obviously I am missing
something.


If you use the AfterUpdate event of a check box on the main
form, the the code would be like this:

Me.nameofsubformcontrol.Form.Requery
 
This approach doesn't seem to work in my case, possibly because the
subform's SourceObject is another form. The sequence I am after is this:

1) Click the Yes/No checkbox in the subform (the SourceObject)
2) SOMETHING (in the subform? the form?) recognizes the change and...
3) ...the SourceObject gets requeried.

Sorry if I did not make this more clear.

Thanks.

David
 
1) Click the Yes/No checkbox in the subform (the SourceObject)
2) SOMETHING (in the subform? the form?) recognizes the change and...
3) ...the SourceObject gets requeried.

Just put

Me.Requery

in the Afterupdate event of the checkbox.
 

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

Back
Top