|
-
Apr 29th, 2000, 07:38 AM
#1
Thread Starter
Hyperactive Member
(2nd Post)
Newbie Here)I have an access database that I am using in VB. I need to return the value of the access database ID# to the program. In other words... I have 30 records, which are actually questions. The program needs to know which question or (Record) is selected. In access, the ID field is set to autonumber and tells which record is being viewed.
How do I do this in VB. I have exhausted my books. They all say how to move to previous, last, next, first, etc., but do not discuss how to show the current record ID.
Is it something like...
dim CurrentRecord as variant
CurrentRecord = data1.recordset.fields("Id")
Trying to figure out which record the database is looking at. Is it record 1 of 30 or record 26 of 30. How do I return this value to my program????
Please offer help.
Thanks,
Sal
-
Apr 29th, 2000, 07:56 AM
#2
Frenzied Member
you didn't expect to get an answer in 20 minutes did you?
I don't know I'm afraid, I'm rubbish with databases, you should get an answer to this though, just wait a while, only 3 people saw your last post between you posting it and then posting this one.
-
Apr 29th, 2000, 08:02 AM
#3
Member
Use AbsolutePosition property of a recordset, and
when you use it add 1 to it because it is zero-based (rsRecordset.AbsolutePosition + 1)
Let me know if you still have problems.
[Edited by mlana on 04-29-2000 at 09:04 PM]
-
Apr 29th, 2000, 09:07 AM
#4
Thread Starter
Hyperactive Member
What is an example of its usage?
I am trying to pass its value to a string named "currentrecord". How do I do this?
dim currentrecord as string
then is it...
currentrecord = data1.recordset.absolutevalue?
This is not working so far. Sorry for the inexperience, trying to learn this.
Thanks
-
Apr 29th, 2000, 10:06 AM
#5
Thread Starter
Hyperactive Member
Should read absoluteposition not absolutevalue, although that's what I'm looking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|