Results 1 to 4 of 4

Thread: MSFlexgrid

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759
    Hi Everyone,

    How do you grab the information from a specific cell in the MSFlexgrid? I have looked through the MSDN library for informantion but have been unable to find related topics for taking information from the MSFlexgrid cells. Do any of you guys know how to do it? I would appreciate any help. Thnak you.

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    You can set / get the text in any given column using
    MSFlexGrid1.TextMatrix(Row, Col)

    n.b. row & col are zero based

    i.e. to get the text in the first row, 2nd column use
    msgbox MSFlexGrid1.TextMatrix(0, 1)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759

    MSFlexgrid

    Hi Everyone,

    I am trying to get an UPDATE sql statement to go into an MS Access database and update inventory amounts. I want the inventory that has been used to be subtracted from the HighPoint and updated in the database. I can get the information from the MSFlexgrid ok, but trying to get it to update the Access table doesn't work. I'm not sure what is going wrong. Any advice. Thanks for your help.


    Dim rowid As Integer
    Dim strSQL As String
    rsItemsByDate.MoveFirst
    With rsItemsByDate
    While rsItemsByDate.EOF = False
    If rsItemsByDate!Date = txtDate.Text Then
    With msgViewToday
    rowid = .Rows - 1
    .TextMatrix(rowid, 0) = rsItemsByDate!ItemNumber
    .TextMatrix(rowid, 1) = rsItemsByDate!ItemAmountLeft
    .Rows = .Rows + 1
    End With
    End If
    rsItemsByDate.MoveNext
    strSQL = "UPDATE ItemLevels SET HighPoint = (HighPoint - '" & msgViewToday.TextMatrix(1, 1) & "') WHERE ItemNumber = '" & msgViewToday.TextMatrix(1, 0) & "'"
    Wend
    End With

  4. #4
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    What is the error message you are getting? What are the data types of HightPoint and ItemNumber in your Access table, I think some of the single quotes in the SQL statement shouldn't be there, depends on the data types though

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