Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290

    Unanswered: setting record pointer

    as Dlookup gives the value of a certain field in a certain table, is there in DAO a method like Dlookup which sets the record pointer (bookmark) to that record ?

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Bookmark


    or if you juist wantto point to the record in the code for some operation

    with rs
    .movefirst
    .move position -1
    end with

    with your postion being your record number in the recordset

  3. #3
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    Bookmark and move are known to me, but i am looking for something else

    what i want is for instance this

    if i use Dlookup the bookmark of the queried table doesn't change, it only returns the value of the field.

    is there anything like this

    MyBookmark = FindBookmark("fieldname", "tablename", "fieldname = MyValue")

  4. #4
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    ok how about this then

    FindFirst, FindLast, FindNext, FindPrevious Methods will help ive never used these before but i think its fairly close to what your needing

  5. #5
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    Yes, you're right David, i just thaught about those, and implemented it, and is nearly what i want, but for now acceptable.

    why i was aking for this is that dynasets don't accept indexes, so I have to sort the recsets, and to set them whenever i need a sequence to loop through, and with the retrieving of the bookmark of a certain record i think i can solve that.

    if you have any thaughts in this direction let me know ..., but anyway thanks for the hints.

    emiel

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I don't know enough about what you are trying to do to give you a good solution, but to answer your question, No there is no function like DLookup to set the bookmark.

    Here are some other things you might look into, if you are using DLookup on the same data as the form, then you might consider a RecordsetClone of the form, search for the record then set Me.Bookmark = rstRecordSetClone.Bookmark

    Another way to search using an index is with the Seek method. You need to work of a dbOpenTable type of recordset. You can't use dbOpenTable on a linked table. You would first have to open the database that the table resides in and then set the recordset object using that database object.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •