Results 1 to 5 of 5

Thread: Still no answer! Is my question too hard...

  1. #1

    Thread Starter
    Hyperactive Member Sal's Avatar
    Join Date
    Mar 2000
    Posts
    262

    Unhappy

    (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

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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.

  3. #3
    Member
    Join Date
    Jan 1999
    Posts
    41
    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]

  4. #4

    Thread Starter
    Hyperactive Member Sal's Avatar
    Join Date
    Mar 2000
    Posts
    262
    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

  5. #5

    Thread Starter
    Hyperactive Member Sal's Avatar
    Join Date
    Mar 2000
    Posts
    262
    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
  •  



Click Here to Expand Forum to Full Width