Access - A field within a sub form that is within a tab

G

Guest

I have a main form with a tab control "CASE TAB CONTROL" with a Tab called "
ACTIVITY TAB" and within that tab I have a subform called "ACTIVITY subform".
The question is how do I refer to a field within that subform within a query.

I have tried:
[forms]![CASE]![ACTIVTY subform]![ACTIVITY ID]
and
[forms]![CASE]![CASE TAB CONTROL]![ACTIVITY subform]![ACTIVITY ID]

In all cases I get an Entder Parmeter Value" error. If I type the value in,
it works.

Thanks and God bless,

Don
 
G

Guest

The syntax should be

Forms![MainFormName]![SubFormName].Form![FieldName]

Or open the main form in design view, then open the query and use the builder.
select forms, loaded form, and the path up to the wanted field.
 
S

Steve Schapel

Don,

The tab control is irrelevant.

Local convention is to put it like...
[Forms]![CASE]![ACTIVTY subform].[Form]![ACTIVITY ID]
.... but this should work ok...
[Forms]![CASE]![ACTIVTY subform]![ACTIVITY ID]

Therefore, if you are getting an "Enter Parameter Value" prompt, I would
say there is a spelling error somewhere, or the way you are using it in
the query is not correct. Is there actually a control on the ACTIVTY
subform caller 'ACTIVITY ID'? Is 'ACTIVTY subform' the exact spelling
of the name of the subform? Are you sure it shouldn't be 'ACTIVITY
subform' instead? Is it the name of the form that you are using for the
subform, or is it the name of the subform control on the main form
(these two are not necessarily the same)? Is 'CASE' the actual name of
the main form? Is the CASE form open at the time that you try to run
the query?
 

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