472,805 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 11306
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.