473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Recordset.Recordcount problem

Alireza355
Dear all,

a few years ago, I made an access database with a lot of forms, queries, etc...

I stopped using the database for a few years, and now that I went back to it, I notice a problem:

In a form, I have a textbox that for it's control source it has:

=[forms]![frmMAINFORM]![frmSUBFORM].[form].[recordset].[recordcount]

but it returns #Name

It seems like it doesn't know anything about recordset.

Any ideas????
Jan 24 '16 #1
3 1683
jforbes
1,107 Expert 1GB
I'm not sure, but I think there was a point in time when that would work. It doesn't work now, which you found out.

I haven't been able to come up with a single line of code that will work as a ControlSource. Instead I would make the ControlSource for your control like this:
Expand|Select|Wrap|Line Numbers
  1. =GetSubRecordsetCount()

and then add something like the following as VBA Code for your Form. This should work if the control for your subform is named 'frmSUBFORM', otherwise replace it in the code below with the actual name of your SubForm Control.
Expand|Select|Wrap|Line Numbers
  1. Private Function GetSubRecordsetCount()
  2.     GetSubRecordsetCount = Me.frmSUBFORM.Form.RecordsetClone.RecordCount
  3. End Function
Jan 25 '16 #2
Dear jforbes,

thank you for your response. I will give it a try and let you know.
Jan 26 '16 #3
Yes, it works. thanx a lot....
Jan 26 '16 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Serge Myrand | last post by:
Hi, I have an ADODB.RecordSet that RecordCount alway return -1 and this RecordSet is plenty of record! R.RecordSet = -1 R.eof = False R.BOF = False Is the cursor is lost somewhere?
8
by: Dave | last post by:
Hi all, I've been trying to figure this out for the last day and a half and it has me stumped. I've got a web application that I wrote that keeps track of trading cards I own, and I'm moving it...
6
by: HKM | last post by:
Hello, I have a query engine that builds the SQL Query to obtain the recordSet. Following is an Exmaple Query that my QueryBuilder outputted SELECT * FROM BookInfo WHERE BookName LIKE...
2
by: Greg Teets | last post by:
The documentation says it will return -1 if it cannot figure out the quantity. That seems kind of goofy to me. Is this a bug? Thanks.
2
by: corepaul | last post by:
I am fairly new to Access and I have a problem trying to use bookmarks with a recordset. I have a recordset dimensioned as, Dim rstFoodDesc As ADODB.Recordset ' recordset Dim bMark As...
1
pureenhanoi
by: pureenhanoi | last post by:
I'm using VB6 and MSAcces DataBase my project have one Conection called: GPcnxn, a Recordset called: GPrs. If i connect to database by DataEnvironment, so, after this command Set...
1
by: Lazster | last post by:
Hi, I'd really appreciate some help here people. I am trying to insert some values in a table in another database and not getting the results I am expecting. I am simply trying to insert values...
18
by: time2hike | last post by:
Big Picture: I am trying to open 2 recordsets and test the results against a set of rules prior to loading data into my database. I have created this as a Sub attached to a command button on a form...
12
Seth Schrock
by: Seth Schrock | last post by:
I have the following subroutine that I'm using to bookmark the current record, do a requery of the form, and then go back to the record that I bookmarked. Here is my code: Private Sub FormRefresh()...
2
by: time2hike | last post by:
I have a command button that pulls an Adobe RecordSet and Exports the data to Excel. One of my users reports getting Error 6 Overflow when running the export for a particular criteria. I thought...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.