473,573 Members | 2,447 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

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
Nov 12 '05 #1
0 8386

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

Similar topics

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
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...
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...
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...
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
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
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...
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...
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 ...
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...
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...
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...
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...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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...

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.