473,854 Members | 1,581 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 2174
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
17522
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
4341
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
3082
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
10593
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
1925
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
26827
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
3170
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
1111
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
3492
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
9901
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
9751
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
11025
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10758
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
10371
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
9513
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...
0
5743
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4159
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.