473,406 Members | 2,293 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,406 software developers and data experts.

get the record number from the access db

hai,
I want to get the record number in access using select statement. please help. Thanks in advance.
indra.G
Dec 9 '06 #1
5 11451
MMcCarthy
14,534 Expert Mod 8TB
hai,
I want to get the record number in access using select statement. please help. Thanks in advance.
indra.G
indra

You cannot get a record number in access. You can only identify it by it's primary key or other unique value.

Mary
Dec 9 '06 #2
ADezii
8,834 Expert 8TB
hai,
I want to get the record number in access using select statement. please help. Thanks in advance.
indra.G
'As far as I know, you cannot retrieve it via a SELECT Statement but this is
'how I retrieve it via VBA coding:

Expand|Select|Wrap|Line Numbers
  1. Dim recClone As DAO.Recordset
  2.  
  3. Set recClone = Me.RecordsetClone()             'Copy of the Form's underlying Recordset
  4. recClone.Bookmark = Me.Bookmark             'Resync Bookmarks
  5. Debug.Print recClone.AbsolutePosition + 1    'Returns the Record Number
Dec 10 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Nice piece of code ADezii.

I assume it only works if the form is based on the table with no criteria or sort order.

Mary

'As far as I know, you cannot retrieve it via a SELECT Statement but this is
'how I retrieve it via VBA coding:

Expand|Select|Wrap|Line Numbers
  1. Dim recClone As DAO.Recordset
  2.  
  3. Set recClone = Me.RecordsetClone()             'Copy of the Form's underlying Recordset
  4. recClone.Bookmark = Me.Bookmark             'Resync Bookmarks
  5. Debug.Print recClone.AbsolutePosition + 1    'Returns the Record Number
Dec 10 '06 #4
Nice piece of code ADezii.

I assume it only works if the form is based on the table with no criteria or sort order.

Mary
Sir,
I have created a database in access and iam using vb as front end. For the data report the data source is dataenvironment.For e.g I have nearly 100 records and i am selecting few records based on a condition in the dataenvironment sql command(select * from contract where vtcno>?) and placing the dataenvironment as the data source to the data reort. The selected records should be numbered(1,2,3...) in the data report by adding an additional field in the data report.
thnaks
indra
Dec 11 '06 #5
MMcCarthy
14,534 Expert Mod 8TB
If you are creating your frontend in VB you might want to post this in the Visual Basic forum as well. Some of their experts do hang out here but you are more likely to get an answer to your question over there.

Mary
Dec 11 '06 #6

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

Similar topics

5
by: HJ | last post by:
Hi all, Consider an Access 2002 run-time application on Windows XP. The controls on a form are locked until the user clicks an Edit button. The form is based on a query and all controls are...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
3
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
9
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...
0
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
27
by: Kim Webb | last post by:
I have a field on a form for project number. I basically want it to be the next available number (ie 06010 then 06011 etc). In the form I create a text box and under control source I put: =!=...
3
by: CourtGuy | last post by:
Hi Folks, I've got a problem that's been confounding me for months. I work for a criminal court, and I'm trying to set up an Access database to track petitions filed by criminal defendants. ...
3
prn
by: prn | last post by:
Hi folks, I've got something that's driving me crazy here. If you don't want to read a long explanation, this is not the post for you. My problematic Access app is a DB for keeping track of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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...
0
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,...

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.