after my sql update at bottom i really wanted to refresh the datagridview prob i got is there could up to 30 records that change with that update.
also if anyone know how to to mass update from that data grid back to a different access table wouold be good too
tnaks
Requestcount = Nothing Requestcount = Convert.ToInt32(InputBox("Please confirm how many cases you want?", "Records", "0")) If IsNumeric(Requestcount) Then MsgBox("Your Entered Value Is : " & Requestcount) sql1 = "SELECT TOP " & Requestcount & " DataImport.SERVICE_PROBLEM_ID, DataImport.OPERATOR_REFERENCE, DataImport.DIRECTORY_NUMBER, DataImport.DATE_LAST_TOUCHED, DataImport.TIMES_TRANSFERRED, DataImport.IssuedtoAgent, DataImport.AgentIssuedtoo, DataImport.[Date Issued], DataImport.Completed FROM DataImport WHERE(((DataImport.IssuedtoAgent)=False)) ORDER BY DataImport.DATE_LAST_TOUCHED;" Else : GoTo home1 End If dbPath1 = VB6.GetPath & "\" & "House.mdb" Dim con1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source ='" & dbPath1 & "'; Jet OLEDB:database password=123") Dim adapter As New OleDbDataAdapter(sql1, con1) Dim dt As New DataTable("DataImport") Dim dr As DataRow Dim holding(30) As String Dim touched(30) As String Dim Countit As Integer adapter.Fill(dt) For Each dr In dt.Rows holding(Countit) += dr("SERVICE_PROBLEM_ID").ToString() touched(Countit) += dr("TIMES_TRANSFERRED").ToString() Countit = Countit + 1 Next con1.Close() DataGridView1.DataSource = dt 'dont need it now Dim sql As String Dim loopcount As Integer loopcount = 0 Do Until Loopcount = Countit sql = "UPDATE DataImport SET DataImport.IssuedtoAgent = 1, DataImport.AgentIssuedtoo = '" & ActUser & "', DataImport.[Date Issued] = '" & Hitme & "' WHERE DataImport.SERVICE_PROBLEM_ID =" & holding(loopcount) & " AND DataImport.TIMES_TRANSFERRED = " & touched(loopcount) & "" Dim cmd As New OleDbCommand(sql, con1) con1.Open() cmd.ExecuteNonQuery() con1.Close() loopcount = loopcount + 1 Loop
also if anyone know how to to mass update from that data grid back to a different access table wouold be good too
tnaks
Last edited by a moderator: