By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,663 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,663 IT Pros & Developers. It's quick & easy.

Trying to requery a subform in access 2000 on an event

P: 1
Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark
Jun 8 '07 #1
Share this Question
Share on Google+
2 Replies

ADezii
Expert 5K+
P: 8,750
Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark
You must Requery the Sub-Form ontrol itself NOT the Source Object which is the Form Name used in the Sub-Form Control.
Jun 8 '07 #2

FishVal
Expert 2.5K+
P: 2,653
Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark

You can require subform in the following way.

Me![frmOpenWorkOrders].Form.Requery

Assumed that the subform control has the name "frmOpenWorkOrders".
Jun 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.