Thank you Klatuu, but I get no records whatsoever. Maybe something in subform
that's not right?
> Opening a recordset is not necessary. All you need is:
>
[quoted text clipped - 21 lines]
> >
> > I get nothing! Why?
How are the form and subform related?
In other words, do you have the Link Master Field(s) and Link Child Field(s)
properties of the subform control set to fields in you form's record source
and subform's recordsource set properly?

Signature
Dave Hargis, Microsoft Access MVP
> Thank you Klatuu, but I get no records whatsoever. Maybe something in subform
> that's not right?
[quoted text clipped - 24 lines]
> > >
> > > I get nothing! Why?
Joao - 29 May 2008 16:39 GMT
No... is because of that? I think I've tried it too but to no avail...
> How are the form and subform related?
> In other words, do you have the Link Master Field(s) and Link Child Field(s)
[quoted text clipped - 29 lines]
> > > >
> > > > I get nothing! Why?
Klatuu - 29 May 2008 16:43 GMT
How is the form's recordset related to the subform's recordset?
Try pasting your SQL into a query in the query designer in SQL view and see
what it returns.

Signature
Dave Hargis, Microsoft Access MVP
> No... is because of that? I think I've tried it too but to no avail...
>
[quoted text clipped - 31 lines]
> > > > >
> > > > > I get nothing! Why?
Joao - 29 May 2008 16:52 GMT
I get records, but when I use the code below it returns none.
> How is the form's recordset related to the subform's recordset?
>
[quoted text clipped - 36 lines]
> > > > > >
> > > > > > I get nothing! Why?
Klatuu - 29 May 2008 17:01 GMT
Okay that anwered one of my questions.
Now, in the subform control on the main form there are two properties, Link
Master Field(s) and Link Child Field(s)
These are used to relate the child records in the subform to the parent
record in the main form. The Link Master Field(s) property should have the
name of the field or fields you use in the main form's recordset to relate to
records in the subform's recordset. The Link Child Field(s) property should
have the name of the field or fields in the subform's recordset you use to
relate to the record in the main form. If these are not set correctly, you
may not get any records in the subform.

Signature
Dave Hargis, Microsoft Access MVP
> I get records, but when I use the code below it returns none.
>
[quoted text clipped - 38 lines]
> > > > > > >
> > > > > > > I get nothing! Why?