473,729 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display record number of record count in a subform

I have a main form with navigation buttons on it and a label showing
for example Record 1 of 15 using recordsetclone on it and eveything
works fine. When I move through the records the record number changes
fine. Within this main form I have a subform detailing distribution
records for the contact (main form is based on this) that also has
navigation buttons and a label showing Distribution 1 of ##. This is
where the problem lies. The first main record has two records in its
subform and shows Distribution 1 of 2. When I move to the next record
on the main form, the subform still shows Distribution 1 of 1, when
this record doesn't actually have any sub records. This happens for
all records I scroll until I reach 13 of 15 which actually has a
subrecord and displays Distribution 1 of 1. When I scroll to previous
records each one now shows Distribution 1 of 1 whereby before I
reached this point is showed Distribution 1 of 2. When I get back to
Record 1 of 15 on the main form the subform label shows Distribution 1
of 2 again and repeats this for each until record 13 of 15 is reached
again. It doesn't seem to update or calculate how many records this
subform is showing and just repeats through the records until a record
actually has data in it.

Can I just add that the subform is showing the correct records it's
just that the label I have used to display the Distribution # of ## is
not updating properly when using the naviagtion buttons.

The subform is based on a table called tblDistribution which records
how many publication distributions a Contact has had. The contact is
the main form/table. As it stands the tblDistribution has 3 records
in it and as I stated above the label is not displaying the amount
each person has correctly.

I need the subform to kind of look at the current contact and
calculate how many distributions they have had and that should be the
value used in the label, but using the clone doesn't seem to do this.

Any help would be greatly appreciated. Thanks in Advance. Carl J
Barrett.

Here is a snip of the code I am using. I haven't included any of the
navigation areas as these work OK.

Dim recClone As Recordset
Dim intTotalRecords As Integer
Dim intCurrentRecor d As Integer

'Make a clone of the recordset underlying the form so
'we can move around that without affecting the form's
'recordset. This clones tblDistribution which currently
'has 3 in it.

Set recClone = Me.RecordsetClo ne()

'move to the last record in the recordset
recClone.MoveLa st

'synchronize the form's and recordset's bookmarks
recClone.Bookma rk = Me.Bookmark

'set the intCurrentRecor d var. Because recordsets are zero based, add
1 to the value
intCurrentRecor d = recClone.Absolu tePosition + 1

'set intTotalRecords var
intTotalRecords = recClone.Record Count

'set RecordDetails caption
lblDistribution Details.Caption = "Distributi on: " & intCurrentRecor d &
" of " & intTotalRecords

'And finally close the cloned recordset
recClone.Close
Nov 12 '05 #1
0 8408

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
9069
by: DS | last post by:
Whenever you use a continous form each row represents a record. Does this record have a number? If so how do you access it. Right now I have a field using auto number. But if access generates its own number for that row I'd like to use that. Thanks DS
11
4662
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which serves as splash screen with the disclaimer of the application is shown. now the problem i am running into is in the display of the disclaimer which is really two page long and it should be formatted too. using a textbox seems not
17
2076
by: perryche | last post by:
I have 5records, e.g. Rc1, Rc2, Rc3..., when user open up a form, I want it to open to a particular record (say Rc3) then when user chooses the Record Selector , it will go to Rc2 and , it will go to Rc4. If I use Sort in the query, it is sorted alphabetically; if I do not sort, whatever is the latest record will be on top. Any help/insight will be appreciated. Perry
1
1654
by: Nick via AccessMonster.com | last post by:
Hello, I'm using a form that has a subform. The subform is linked to a hidden datasheet form, and the subform displays records from the form. The problem is, the subform will only show X number of records, and one additional record for data entry. My boss wants me to show an entire sheet, with many rows available for data entry (Because it looks better). Is there a property that can be changed to show the subform in this way?
12
12947
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can we prevent this from happening? Thanks. ming
12
20930
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database contains the paths to the pictures. The database consists of two tables: TABLE DATA ID Name LastName
2
1777
by: joan.edington | last post by:
Hi, I've not done a lot of MS Access work and have been tasked with creating a database to record and report on stages of complaints cases. Each set of records for a case has a header, any number of complaint follow-ups and any number of actions or outcomes against the case. Each of these have different forms, with the case number being the connecting key, and a date/time field.
7
3055
by: Stephen Poley | last post by:
I have the following situation: - a table of employees, keyed on employee-id; - a table of training sessions, keyed on session-id; - a requirement to log who was present at which session, plus optional extra textual information (e.g. "left early due to illness"). The solution I had in mind was: 1) create a presence table, keyed on employee-id and session-id, containing a 'present' yes/no field and a comment text field; 2) cross-join...
4
2645
by: vidiot | last post by:
I am trying to create a subform that will display images related to the parent form. The subform is a continuous form as there will be several images that relate to the parent form. I checked Access help and it gave me the following code, which I have adapted for my database and it works well as a SINGLE FORM. Option Compare Database Private Sub Form_Current()
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.