Results 1 to 5 of 5

Thread: Msflexgrid question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    I have no problem using Msflexgrid to display table from Microsoft Access to the screen. But how do I extract the correct record from my access table for user to edit/delete when they click on certain row inside the msflexgrid?

    TIA
    CT

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Sydney, Australia
    Posts
    74
    When the user clicks on a row, the row property of the flexgrid is set to be that row (0 based). By looking in the correct column of that row, you should be able to get the Primary key of the table? Then finding the correct row should be no problems.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    some of my problems is solved with code something like this:

    private sub flex1_click()
    Mtext = flex1.text
    end sub

    Above code indicated that I can correctly extract data into mtext when user click on different row. However it only show the column 1 text, I am trying to figure out how to extract column 2 and column text as well.
    CT

  4. #4

    Change the COL value

    Private Sub MSFlexGrid1_Click()
    MSFlexGrid1.Row = MSFlexGrid1.RowSel
    MSFlexGrid1.Col = 1
    data = MSFlexGrid1.Text
    MSFlexGrid1.Col = 2
    data = data & " " & MSFlexGrid1.Text

    x = MsgBox(data)

    End Sub

    _______________________________________

    You just need to change the COL value, either as crudely as I've done it or by looping through cols until max cols has been reached.

    Bob

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    Thanks VBOB, your code provide a great help to me.
    CT

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