Curious on Rich's Recordcount advise (1 Viewer)

ShaneMan

Registered User.
Local time
Today, 03:47
Joined
May 9, 2005
Messages
1,224
Rich helped Latex88 a little further down and the advise given was:

"=Count(*) in the control source of a textbox in the subform footer will do it, no vba is needed"

I tried this out out on a few of my subforms and it worked on all but one. The recordsource of the one that it does not work on is based on a query. When I changed the recordsource to a table then the recordcount works.

Curious as to why and is there a work around?

Thanks a head of time,
Shane
 

ShaneMan

Registered User.
Local time
Today, 03:47
Joined
May 9, 2005
Messages
1,224
Thank you for the reply Mr. Hudson. I'm getting a type mismatch message at this point:
Set rs = Me.RecordsetClone

Any thoughts?

Shane
 

ghudson

Registered User.
Local time
Today, 06:47
Joined
Jun 8, 2002
Messages
6,195
I believe that you need to set a reference to the Microsoft DAO 3.X Object Library.

OR

Dim rs As DAO.Recordset
 

ShaneMan

Registered User.
Local time
Today, 03:47
Joined
May 9, 2005
Messages
1,224
Mr. Hudson,

DAO.Recordset got it done. I appreciate your help.

Thanks,
Shane
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:47
Joined
Feb 19, 2002
Messages
43,430
Having a query as its RecordSource should not impact the aggregate function in the subform's footer. There is some other problem.
 

ShaneMan

Registered User.
Local time
Today, 03:47
Joined
May 9, 2005
Messages
1,224
Ms. Hartman,

With that being said, do you have any suggestions on where I might start looking for other problems? One other thing this same query has caused me a problem with is filtering when it is first called. I use it as a subform. On the main form I click a cmdButton which resets the SourceObject of the subform (on the main form) to this query. At that call, if I put a criteria in the QBE, it doesn't work. All the command buttons, on the subform itself, to filter the query, do work.

Any thoughts?

Thanks for you help,
Shane
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:47
Joined
Feb 19, 2002
Messages
43,430
You are actually using the query as a subform? That may be what is causing the problem. Create a form in datasheet view and use that instead of the naked query.
 

ShaneMan

Registered User.
Local time
Today, 03:47
Joined
May 9, 2005
Messages
1,224
No, I'm not actually using a query as a subform. I'm using the query as the Recordsource for the subform. The subform is in continuous form view. I choose not to use datasheet view because I do not like the looks of it.

Any thoughts now that is cleared up?
Shane
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:47
Joined
Feb 19, 2002
Messages
43,430
Try posting a db with just the form, queries, and tables.
 

Users who are viewing this thread

Top Bottom