DSum and DLookUp giveing #Name?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using the following in a text box on a form:

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=' " &
[KKMasterRelID] & " ' ")

The form name is KKReleaseMasterForm1.
[QtyRqd] from the table "KKReleaseDetailTable" is what I want to sum and
show on the form. I would like the AutoID field [MasterReleaseID] to match
the AutoNumber Field [KKMasterRelID] from the form.

Any idea why I'm getting this #Name? instead of the data I'd like to see?
 
I'm using the following in a text box on a form:

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=' " &
[KKMasterRelID] & " ' ")

The form name is KKReleaseMasterForm1.
[QtyRqd] from the table "KKReleaseDetailTable" is what I want to sum and
show on the form. I would like the AutoID field [MasterReleaseID] to match
the AutoNumber Field [KKMasterRelID] from the form.

Any idea why I'm getting this #Name? instead of the data I'd like to see?

1) Make sure the NAME of this control, is not the same as the name of
any field in the control source expression.

2) Because [MasterReleaseID] is a Number datatype field you must use a
different syntax in the Where clause portion (yours is suitable for
Text datatype).

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=" &
[KKMasterRelID])

In VBA help, look up "Restrict data to a subset of records".
 
Thank you for your response.
When you write....make sure the name of the Control is not the same as the
name of any field in the control source expression...? I'm sorry, I don't
know which part of this is called the "name of the Control ?? also by the
control source expression, do you mean the table or query I'm summing the
data from or the form field / text box that I'm trying to use as criteria to
limit the data?

fredg said:
I'm using the following in a text box on a form:

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=' " &
[KKMasterRelID] & " ' ")

The form name is KKReleaseMasterForm1.
[QtyRqd] from the table "KKReleaseDetailTable" is what I want to sum and
show on the form. I would like the AutoID field [MasterReleaseID] to match
the AutoNumber Field [KKMasterRelID] from the form.

Any idea why I'm getting this #Name? instead of the data I'd like to see?

1) Make sure the NAME of this control, is not the same as the name of
any field in the control source expression.

2) Because [MasterReleaseID] is a Number datatype field you must use a
different syntax in the Where clause portion (yours is suitable for
Text datatype).

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=" &
[KKMasterRelID])

In VBA help, look up "Restrict data to a subset of records".
 
Thank you for your response.
When you write....make sure the name of the Control is not the same as the
name of any field in the control source expression...? I'm sorry, I don't
know which part of this is called the "name of the Control ?? also by the
control source expression, do you mean the table or query I'm summing the
data from or the form field / text box that I'm trying to use as criteria to
limit the data?

fredg said:
I'm using the following in a text box on a form:

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=' " &
[KKMasterRelID] & " ' ")

The form name is KKReleaseMasterForm1.
[QtyRqd] from the table "KKReleaseDetailTable" is what I want to sum and
show on the form. I would like the AutoID field [MasterReleaseID] to match
the AutoNumber Field [KKMasterRelID] from the form.

Any idea why I'm getting this #Name? instead of the data I'd like to see?

1) Make sure the NAME of this control, is not the same as the name of
any field in the control source expression.

2) Because [MasterReleaseID] is a Number datatype field you must use a
different syntax in the Where clause portion (yours is suitable for
Text datatype).

=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=" &
[KKMasterRelID])

In VBA help, look up "Restrict data to a subset of records".

The name of the control can be found on the controls Property sheet's
Other tab. It CANNOT be the same as the name of any of the field shown
in the control's control source.
This is the control's control source:
=DSum("[QtyRqd]","KKReleaseDetailTable","[MasterReleaseID]=' " &
[KKMasterRelID] & " ' ")

Therefore, the Name of the control cannot be "QtyRqd", nor
"KKReleaseDetailTable" nor "MasterReleaseID, nor "KKMasterRelID"

If the control's name is one of the above, change it to something
else.

Don't forget to change the where clause portion as indicated in my
previous post, as you have a Number datatype field, not Text, as
criteria.
 
Back
Top