Results 1 to 3 of 3

Thread: Selecting a record in a recordset

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    How do you know which record was selected in a DataGrid? I have programmatically linked the datagrid to a recordset of two joined tables. I think in the click event for the datagrid I should be able to use the bookmark, or the row, to ascertain which of the records was clicked on.
    From there I want to pick up two of the elements of the recordset, and create a new join based on the two values.

    This works with a combobox by using the index property - on a click, I set a variable equal to the index, move to the first record, and then count through to the one I want.

    This seems like it should be just as easy with a datagrid - but I am baffled and bamboozled!


  2. #2
    Lively Member
    Join Date
    Mar 1999
    Posts
    93

    Post

    When you click datagrid to select a row, the record you mark becomes current and recordset pointer automatically skips to it. You don't have to write any code to determine it

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    I use dbgrid, which allows you to specify the column value to select data. For example:


    sID = form.dbgrid.columns(0).value

    sets sID to whatever is stored in the selected row, column 0. You just need to know what columns you're interested in...

    [This message has been edited by JHausmann (edited 10-30-1999).]

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