From-subform

J

Jean-Paul

Hi
I have a form OD_Situatie
This form has 1 subform named sub4

Upon opening this form I want to be able to set the recordset of the
subform.

I can not find the correct syntax to point to the recordset of the subform.

I thought sabout something like:

[Forms]![OD_Situatie]!Sub4.Recordset = "whatever SQL"
 
M

Marshall Barton

Jean-Paul said:
I have a form OD_Situatie
This form has 1 subform named sub4

Upon opening this form I want to be able to set the recordset of the
subform.

I can not find the correct syntax to point to the recordset of the subform.

I thought sabout something like:

[Forms]![OD_Situatie]!Sub4.Recordset = "whatever SQL"


If you want to set a form's recordset, then you would have
to set it to an open recordset object variable. It looks
more like you want to set the form's RecordSource property
to an SQL statement. If so, it could be:

Me.Sub4.Form.RecordSource = "whatever SQL"
 
J

Jean-Paul

it turned out to be:

Me!Sub4.Form.RecordSource = SQL_Commando_2

Thanks

Marshall said:
Jean-Paul said:
I have a form OD_Situatie
This form has 1 subform named sub4

Upon opening this form I want to be able to set the recordset of the
subform.

I can not find the correct syntax to point to the recordset of the subform.

I thought sabout something like:

[Forms]![OD_Situatie]!Sub4.Recordset = "whatever SQL"


If you want to set a form's recordset, then you would have
to set it to an open recordset object variable. It looks
more like you want to set the form's RecordSource property
to an SQL statement. If so, it could be:

Me.Sub4.Form.RecordSource = "whatever SQL"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top