add a field to existing form (1 Viewer)

shafh

Registered User.
Local time
Today, 00:31
Joined
Jun 23, 2003
Messages
27
Hello People!
I have an existing form (ParentTemplate) that consists of 14 tabs. Some of the tabs contain subforms. I am trying to add a field in the "Issuer" tab. The Issuer tab does not contain any subforms and is getting data for its existing 6 fields from the ParentIssuerList table. I want to add a new field to the "Issuer" tab that has its control source in a new query I have created named "ParentIssuerListCrosstabQuery". Everytime I use the Expressionbuilder in the controlsource to add [ParentIssuerListCrosstabQuery ]![Total Of Amount] into my text box I get the #Name? error.
How can I get the "Total of Amount" field to show in my Issuer tab?
Thanks,
Sam
 

batman26

Registered User.
Local time
Yesterday, 23:31
Joined
Jul 13, 2003
Messages
22
Add a Field

You could try setting the Default Value to your crosstab query and set the ControlSource to a field in the ParentIssuerList table named [Total Of Amount]
 

shafh

Registered User.
Local time
Today, 00:31
Joined
Jun 23, 2003
Messages
27
Batman,
The [Total Of Amount] field is in the [ParentIssuerListCrosstabQuery] and not the ParentIssuerList table.
I tried setting the default to
[ParentIssuerListCrosstabQuery ]
and typing in [Total Of Amount] as the control source but I still get the #Name? error.

p.s. I checked to see if the field [Total Of Amount] works correctly in the crosstab query and it does.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:31
Joined
Feb 19, 2002
Messages
43,768
You can't refer to a field in a recordset unless it is the recordset bound to the form. You can use ADO/DAO or domain functions to get the data and populate an unbound textbox. DLookup() will probably be easiest for you.

=DLookup("[Total Of Amount]", "[ParentIssuerListCrosstabQuery]", somecriteria)

You'll need to replace somecriteria with something that will limit the number of rows returned to ONE. Use help to see examples of syntax.
 

Users who are viewing this thread

Top Bottom