My suggestion was predicated on a reference to the DAO library which you obviously do not have set. Using a variant results in late binding which is not efficient. Given that you are using ADO as the current data access library, the recordset and recordset clone syntax may be a bit different from what I suggested and as a result, it is not working as desired.
Try it again with:
Set tmprs = [DataFabric subform].Form.Recordset
rather than the clone. In DAO I always use the clone so as not to move the form current record but I'm not certain whether this will work with your current default references. The machine I am working at today only has Access 97 so I am unable to verify the ADO or ADOX requirements.
With DAO and RecordsetClone, (which may not work without an explict reference set from the module toolbar - Tools - References), and assuming the field that the control is bound to has the same name as the control:
Dim tmprs As DAO.Recordset
Dim fld As DAO.Field
Set tmprs = [DataFabric subform].Form.RecordsetClone
tmprs.MoveFirst
While Not tmprs.EOF
For Each fld in tmprs.Fields
If fld.Name = "FabricID" Then
tmpstring = tmpstring & tmpcontrol & " : "
End If
If fld.Name = "EstimatedCost" Then
tmpstring = tmpstring & tmpcontrol.name & " ->" & tmpcontrol.Value & vbCrLf
End If
Next
tmprs.MoveNext
Wend
Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]