Urgent Record Count Problem

G

Guest

This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc. but to no
avail.

Is there one Control Source that I can use to count the records that will
work consistently in Access XP and 2003?
 
K

Ken Snell [MVP]

This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])
 
G

Guest

Hi Ken, Thanks for the help but SRC now displays #Error

Ken Snell said:
This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

jez123456 said:
This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc. but to no
avail.

Is there one Control Source that I can use to count the records that will
work consistently in Access XP and 2003?
 
K

Ken Snell [MVP]

Post the expression you're using for the control source based on what I
posted.

--

Ken Snell
<MS ACCESS MVP>

jez123456 said:
Hi Ken, Thanks for the help but SRC now displays #Error

Ken Snell said:
This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

jez123456 said:
This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc. but
to
no
avail.

Is there one Control Source that I can use to count the records that will
work consistently in Access XP and 2003?
 
G

Guest

=DCount("*", [Form].[Recordsource])

Does [Form] mean [Form] or the main form name or the subform name?


Ken Snell said:
Post the expression you're using for the control source based on what I
posted.

--

Ken Snell
<MS ACCESS MVP>

jez123456 said:
Hi Ken, Thanks for the help but SRC now displays #Error

Ken Snell said:
This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc. but to
no
avail.

Is there one Control Source that I can use to count the records that will
work consistently in Access XP and 2003?
 
K

Ken Snell [MVP]

[Form] is a literal entry. Do not replace it with anything.

It tells ACCESS to look at the recordsource of the form on which the control
is placed.

Are you wanting to get the record count of a subform and show it in a
control on the main form? Or get the record count of the main form and show
it in a control on a subform?

--

Ken Snell
<MS ACCESS MVP>


jez123456 said:
=DCount("*", [Form].[Recordsource])

Does [Form] mean [Form] or the main form name or the subform name?


Ken Snell said:
Post the expression you're using for the control source based on what I
posted.

--

Ken Snell
<MS ACCESS MVP>

jez123456 said:
Hi Ken, Thanks for the help but SRC now displays #Error

:

This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount].
The
SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount].
The
SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc.
but
to
no
avail.

Is there one Control Source that I can use to count the records
that
will
work consistently in Access XP and 2003?
 
G

Guest

The record count is of a subform shown in a textbox on the same subform.

Ken Snell said:
[Form] is a literal entry. Do not replace it with anything.

It tells ACCESS to look at the recordsource of the form on which the control
is placed.

Are you wanting to get the record count of a subform and show it in a
control on the main form? Or get the record count of the main form and show
it in a control on a subform?

--

Ken Snell
<MS ACCESS MVP>


jez123456 said:
=DCount("*", [Form].[Recordsource])

Does [Form] mean [Form] or the main form name or the subform name?


Ken Snell said:
Post the expression you're using for the control source based on what I
posted.

--

Ken Snell
<MS ACCESS MVP>

Hi Ken, Thanks for the help but SRC now displays #Error

:

This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The
SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct
record
count.
If the SRC Control Source =[Form].[RecordsetClone].[RecordCount]. The
SRC
displays #Name

I've tried many different ways of qualifying the form/subform etc. but
to
no
avail.

Is there one Control Source that I can use to count the records that
will
work consistently in Access XP and 2003?
 
K

Ken Snell [MVP]

Works fine for me in this situation....

What else can you tell me about your setup?
--

Ken Snell
<MS ACCESS MVP>


jez123456 said:
The record count is of a subform shown in a textbox on the same subform.

Ken Snell said:
[Form] is a literal entry. Do not replace it with anything.

It tells ACCESS to look at the recordsource of the form on which the control
is placed.

Are you wanting to get the record count of a subform and show it in a
control on the main form? Or get the record count of the main form and show
it in a control on a subform?

--

Ken Snell
<MS ACCESS MVP>


jez123456 said:
=DCount("*", [Form].[Recordsource])

Does [Form] mean [Form] or the main form name or the subform name?


:

Post the expression you're using for the control source based on what I
posted.

--

Ken Snell
<MS ACCESS MVP>

Hi Ken, Thanks for the help but SRC now displays #Error

:

This should work in both versions:

SRC Control Source =DCount("*", [Form].[Recordsource])


--

Ken Snell
<MS ACCESS MVP>

This is very odd.

I have an application with many forms and subforms.

Each form and subform has a field called SRC.

For a TEST form running under Access XP:-
If the SRC Control Source =Count(*). The SRC displays #Name
If the SRC Control Source
=[Form].[RecordsetClone].[RecordCount].
The
SRC
displays the correct record count.

For the same TEST form running under Access 2003:-
If the SRC Control Source =Count(*). The SRC displays the correct
record
count.
If the SRC Control Source
=[Form].[RecordsetClone].[RecordCount].
The
SRC
displays #Name

I've tried many different ways of qualifying the form/subform
etc.
but
to
no
avail.

Is there one Control Source that I can use to count the
records
that
will
work consistently in Access XP and 2003?
 

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