i need to export the infromation from msflexgrid1 to tbltransfer in my access.db

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steve proctor
    New Member
    • Dec 2010
    • 7

    i need to export the infromation from msflexgrid1 to tbltransfer in my access.db

    '.............. ............... .....
    sql = "SELECT * from tbltransfer2"
    Set RecSet = dbAbbeytheatre. OpenRecordset(s ql)

    If Daynum = "" Then
    RecSet.AddNew
    '////////////////////////////////////////////
    Dim I%, j%, strRowText$
    With MSFlexGrid1

    For I = 1 To .Rows + 1

    strRowText = ""

    For j = 1 To .cols + 1

    strRowText = strRowText & .TextMatrix(I, j) & ";"
    '////////////////////
    RecSet!Daynum = MSFlexGrid1.Col = 1
    RecSet!seatNum = MSFlexGrid1.Col = 2
    RecSet!seatId = MSFlexGrid1.Col = 3
    RecSet!BookDate = MSFlexGrid1.Col = 4
    RecSet!BookedBy = MSFlexGrid1.Col = 5
    RecSet!cost = MSFlexGrid1.Col = 6
    RecSet.Update
    '/////////////////////
    Next j

    Next I

    End With
    End If
    Close #1
  • smartchap
    New Member
    • Dec 2007
    • 236

    #2
    In tbltransfer create fields as per name of columns in msflexgrid1. In a For..Next loop, starting from 1 to last row of msflexgrid1 export data of each column to fields of tbltransfer by using rs.AddNew and rs.Update (where rs is name of Recordset for tblTransfer).

    Comment

    Working...