Filtering Subform working, Requery Not Working

E

Emma

May form have an option group. When I select the option I
want, I have a subform which has a combo box in it that
gets filtered based on my main form selection. This works
great. But when I change my selection in the main form, I
get the error that Access cannot find my subform.

The query in my combo box is:

SELECT tbl_Lit_Broch.Discipline,
tbl_Lit_Broch.Description, tbl_Lit_Broch.ID FROM
tbl_Lit_Broch WHERE tbl_Lit_Broch.Discipline=Forms!
Frm_Jobs_Emma.Discipline_Frame;

This part works.

My Option group AfterUpdate Code (which doesn't work) is
as follows:

Private Sub Discipline_Frame_AfterUpdate()
Forms!Sfrm_Tbl_Lit_Broch_Line!Lit_Broch_Combo.Requery
End Sub

Am I missing something in referencing the subform?
 
E

Emma

That works!!! Thank you so much.


-----Original Message-----
Emma, Here's a great place to find the info.
http://www.mvps.org/access/forms/frm0031.htm

Change referencing the subform control to:
Forms!MyMainForm!MySubForm.Form![MyControlName].Requery

--
Reggie

----------
May form have an option group. When I select the option I
want, I have a subform which has a combo box in it that
gets filtered based on my main form selection. This works
great. But when I change my selection in the main form, I
get the error that Access cannot find my subform.

The query in my combo box is:

SELECT tbl_Lit_Broch.Discipline,
tbl_Lit_Broch.Description, tbl_Lit_Broch.ID FROM
tbl_Lit_Broch WHERE tbl_Lit_Broch.Discipline=Forms!
Frm_Jobs_Emma.Discipline_Frame;

This part works.

My Option group AfterUpdate Code (which doesn't work) is
as follows:

Private Sub Discipline_Frame_AfterUpdate()
Forms!Sfrm_Tbl_Lit_Broch_Line! Lit_Broch_Combo.Requery
End Sub

Am I missing something in referencing the subform?


.
 

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