referencing a field in a subform

ducker

across the pond
Local time
Today, 04:23
Joined
Jan 6, 2005
Messages
55
I'm trying to reference a field in a subform to assist a query I'm writing on the form to populate a list box.

The help info is not very helpful in assisting me.
taken from the Access 97 help files:

To refer to a subform or subreport
Refer to the subform or subreport control on the form or report that contains the subform or subreport, then use the Form or Report property of the control to refer to the actual subform or subreport.

· Type the identifier for the form that contains the subform, followed by the name of its subform control, the . (dot) operator, and the Form property. For example, the following identifier refers to the Orders Subform subform on the Orders form:

Forms![Orders]![Orders Subform].Form

---

I would assume that to reference a field within that subform, you simply add on the field name. This does not work.

Any ideas?

Thanks,
Mike
 
It should work. Here's one I've used:

Forms!frmWeek!frmWeekExtra.Form![EXTRAPERC_ID].Requery

The subform is frmWeekExtra. The field on the subform is [EXTRAPERC_ID].

Make sure you're using the Name value of the subform and not the Source Object value to identify the subform.

If i'm not sure of the reference I sometimes open the expression builder and drill down through the forms until i find the subform and double-click on it to paste it to the expression window then i simply cut that value from the expression builder window and paste it into the code window.

w
 
Ok, I got this to work.. woohoo.
Thanks for the helping hand.

It's funny, I never use the "expression builder" anymore, but I will look towards it for hints in the future!

Thanks

-Mike
 

Users who are viewing this thread

Back
Top Bottom