using [Forms]![Subform1]![Subsubform1][fieldname]

  • Thread starter mark_jm via AccessMonster.com
  • Start date
M

mark_jm via AccessMonster.com

I have a data sheet view of a form [subsubform1](datasheet view), on another
form [subform1], subform1 is on yet another form [form1].

The query that is the dadasource for subsubform1 uses a criteria [Forms]!
[subform1][fieldname], to pull out data from the datasource query for display
in subsubform1. Thefield containing the value [fieldname], is on subform1.

When I test subform1 it works fine, but as soon as I drop it onth form1, to
dosnt. I get a dialogbox asking me for the value [Forms]![Subform1]!
[fieldname], each time the form1 is opened.

I guess I need to change the criteria expression so it links properly to
form1? as well as or instead of subform1, but I cant get it right?

Any one offer any advice.

Thanks

Mark
 
M

mark_jm via AccessMonster.com

Many thanks for your help.

Mark

Allen said:
Mark, you need to include the .Form bit:
[Forms]![Subform1].[Form]![Subsubform1].[Form]![fieldname]

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
I have a data sheet view of a form [subsubform1](datasheet view), on
another
[quoted text clipped - 12 lines]
I guess I need to change the criteria expression so it links properly to
form1? as well as or instead of subform1, but I cant get it right?
 
M

mark_jm via AccessMonster.com

OK so using the logic
[Forms]![Formname].[Form]![subformname]![fieldname].

this works.

Now

I my Form has 2 seperate sub forms. The above works for the one subform but
not the second?

Is it me or is this a limitation in Access?

Mark

Allen said:
Mark, you need to include the .Form bit:
[Forms]![Subform1].[Form]![Subsubform1].[Form]![fieldname]

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
I have a data sheet view of a form [subsubform1](datasheet view), on
another
[quoted text clipped - 12 lines]
I guess I need to change the criteria expression so it links properly to
form1? as well as or instead of subform1, but I cant get it right?
 
A

Allen Browne

Might be a timing issue. When are you doing this?

Access will load one subform before the other, so one will load before the
other. If you are referring to the other subform in (say) Form_Open,
Form_Load, or Form_Current, it will fail one way but not the other.

Similarly, if you have a circular reference (e.g. where the form depends on
the query for data, but the query has to read a value from the form before
it can supply the data), it may work in one version of Access and fail in
another.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.
mark_jm via AccessMonster.com said:
OK so using the logic
[Forms]![Formname].[Form]![subformname]![fieldname].

this works.

Now

I my Form has 2 seperate sub forms. The above works for the one subform
but
not the second?

Is it me or is this a limitation in Access?

Mark

Allen said:
Mark, you need to include the .Form bit:
[Forms]![Subform1].[Form]![Subsubform1].[Form]![fieldname]

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
I have a data sheet view of a form [subsubform1](datasheet view), on
another
[quoted text clipped - 12 lines]
I guess I need to change the criteria expression so it links properly to
form1? as well as or instead of subform1, but I cant get it right?
 

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