473,624 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to go to a particular record using recordcount

2 New Member
here is my problem.

i have two records. one containing 20 records and second containing 30 records.
now i want the recordcount property to use and go to the 21 record.
i m calculating the recordcount of both the record. now i m doing this
Expand|Select|Wrap|Line Numbers
  1.  a =  rs.recordcount 
  2.  b =  rs1.recordcount 
  3.  
  4. for x = b+1 to  a 
  5.  
  6.   rs.move(x)
  7.  
  8.  
but its not going to 21 record but it is going to 22 nd record.

can anyone please help me wiith that . how i can go to the 21 record using recordcount .
Apr 8 '07 #1
2 2159
iburyak
1,017 Recognized Expert Top Contributor
Try this:

[PHP]
rs.MoveFirst
rs.Move 21[/PHP]

Always move to first before moving to any number. Otherwise it will be relative to current record.

Example:
If you are on record 5 and you say
rs.move 21
It will go to 21st record starting from 5 it will appear on 26.

Good Luck.
Apr 9 '07 #2
cmrhema
375 Contributor
Try this:

[PHP]
rs.MoveFirst
rs.Move 21[/PHP]

Always move to first before moving to any number. Otherwise it will be relative to current record.

Example:
If you are on record 5 and you say
rs.move 21
It will go to 21st record starting from 5 it will appear on 26.

Good Luck.
Thank you iburyak. I have a similiar problem. I will sort now.
Apr 9 '07 #3

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

Similar topics

10
17492
by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method docmd.gotorecord aclast but i did not
5
4325
by: Ilan Sebba | last post by:
When it comes to adding records in related tables, Access is really smart. But when I try to do the same using ADO, I am really stupid. Say I have two parent tables (eg Course, Student) and one child table (StudentProgress). The course progress records how a student progresses on a course. I have one course (History) and one student called Maya. I now want to record her grade (64). If I do this in Access using a form, then the form...
6
3065
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a record such as: part number 202354-001 location C1-01
1
10576
by: Ryan | last post by:
I've got a problem I have't run up against before. I generally test for an empty recordset using BOF and EOF. Today, for the first time I ran into a problem where my recordset shows BOF and EOF = true despite the fact that there is has an actual record (record count = 1). The count is correct, there should be one record (it shows on the form), but it is not accessible in the recordset. Does anyone know why this might be? The code is...
8
1919
by: MLH | last post by:
Before running the following line of code, I would like to first know if there is another record in the form's record source. If I run this line when the last record is current, an error is returned. Any way to take a peek first? DoCmd.GoToRecord acActiveDataForm, "frmEnterLienAmounts", acNext
7
26817
by: Mike | last post by:
I have a form where I have turned off the default navigation buttons. I then created my own. This works fine. The only questions that I have is on the default navigation buttons it shows total records. How can I show this? I have a text box that shows the current record using: Text1 = Me.Current I want to show the total number of records. How do I do this?
26
3138
by: Jimmy | last post by:
ill have a database with 1 table and 3 fields: ID FIRSTNAME LASTNAME (the ID field will be the auto incrementing index) there might be 10 records in the DB, there might be 10,000. i need to open the DB and randomly select a record (and then display the name, which i dont have a problem with) how can i randomly select a record? im guessing id have to open a recordset
0
1103
by: GeryLuz | last post by:
Hi !! I have a problem showing a users table in an ASP page. It shows me only one record when i checked that there are more than one in my table. But when i print the RecordCount property of each recordset all of them show me a -1. What is happening?? :( Please, help!! Here is the code:
4
3476
by: aaronyoung | last post by:
I have created custom navigation buttons and Record Number indicators on several forms that are used to review and update records based on a query. My On Current event to update the "Record X of Y" is Private Sub Form_Current() Dim frm As Form, LastRec As Long Set frm = Forms!ReviewSearchRecordsForm
0
8238
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
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8624
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...
0
8478
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
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
6111
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
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
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
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.