Filtering Subform working, Requery Not Working

  • Thread starter Thread starter Emma
  • Start date Start date
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?
 
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?


.
 
Back
Top