gemma,
since this is a subform, you cannot reference like that, because a subform is not a member of the forms collection, but a control on the main form on which it resides. You do mean controls, don't you? A form doesn't contain a fields collection. You can reach the forms controls collection within it's class module through for instance using the Me keyword, i e
Me!txtOrderNumber.DefaultValue
for each ctl in me.controls
debug.print ctl.defaultvalue
next ctl
or fully qualified reference, going through the main form, like for instance
forms!frmMaintenanceEntries!sfmParts.Form!txtOrderNumber.DefaultValue,
forms("frmMaintenanceEntries").Controls("sfmParts").Form.Controls("txtOrderNumber").DefaultValue
for each ctl in forms("frmMaintenanceEntries").Controls("sfmParts").Controls
debug.print ctl.defaultvalue
next ctl
or similar, though I would always prefer the Me keyword when working within a class module. I think that when coding in a class module, using a fully qualified reference, at least to me, means you're referring "outside the class (form)", and then back to the same class module. I e,
Me!txtSomeControl
in stead of
forms!frmMain!frmSub.Form!txtSomeControl
Sometimes, especialy when doing automation, a coding style like that might leave you an extra instance of the automated application in memory.
For some info, check out the article boblarsson put in the faq section, or perhaps
http://support.microsoft.com/kb/209099
You can also use the
Form_FormName.txtMyControl
syntax, which some claims work flawlessly with subforms too, but you'll run a chance of instantiating/opening it as a form, if it isn't alredy open, either as a single form, or as part of a main/sub form setup.
Did I understand your question?