The dlookup shouldn't return error when you are using it in a sub form, can
you post the dlookup you are using, and how do you use it
If you filter the dlookup on a value from the main form, the the path should
be different
=dlookup("FieldName","TableName","FieldName=" &
Forms![MainFormName]![FieldName])
Now if you filter on a number, it should be
=Dlookup("FieldName","TableName","FieldName=" & Value )
Now if you filter on a String, it should be
=Dlookup("FieldName","TableName","FieldName='" & Value & "'")
Now if you filter on a String, it should be
=Dlookup("FieldName","TableName","FieldName=#" & Value & "#")