Sub btnEdit_Click
'Finish this later. maybe add form to fill out
Try
Dim RowId As Long = GetRowId(Sender)
Dim Item As Map = B4XTable1.GetRow(RowId)
Dim WhatRo, WhatDate, WhatFirstName, WhatLastName, WhatVin, WhatYear, WhatMake, WhatModel, WhatFilename As String
WhatRo = Item.GetDefault("RO", "")
WhatDate = Item.GetDefault("Date", "")
WhatFirstName = Item.GetDefault("First", "")
WhatLastName = Item.GetDefault("Last", "")
WhatVin = Item.GetDefault("VIN", "")
WhatYear = Item.GetDefault("Year", "")
WhatMake = Item.GetDefault("Make", "")
WhatModel = Item.GetDefault("Model", "")
WhatFilename = Item.GetDefault("File Name", "")
Dim id As InputDialog
Dim sf As Object = id.ShowAsync("", "Enter RO Update", "Ok", "", "Cancel", Null, False)
Wait For (sf) Dialog_Result(Result As Int)
If Result = DialogResponse.POSITIVE Then
WhatRo = id.Input
WhatYear = "1111"
End If
' Private Query As String
' Private Cursor1 As Cursor
'
' 'first we check if the entry already does exist
' Query = "SELECT * FROM diagnosticlog WHERE RO = ? AND Date = ? AND FirstName = ? AND LastName = ? AND VIN = ? AND Year = ? AND Make = ? AND Model = ? AND FileName = ?"
' Cursor1 = Starter.SQL1.ExecQuery2(Query, Array As String (WhatRo, WhatDate, WhatFirstName, WhatLastName, WhatVin, WhatYear, WhatMake, WhatModel, WhatFilename))
'
' If Cursor1.RowCount > 0 Then
' Log("yes")
' End If
Starter.SQL1.ExecNonQuery2("UPDATE diagnosticlog SET RO = ?, Date = ?, FirstName = ?, LastName = ?, VIN = ?, Year = ?, Make = ?, Model = ?, FileName = ? WHERE rowid = ?", Array As String(WhatRo, WhatDate, WhatFirstName, WhatLastName, WhatVin, WhatYear, WhatMake, WhatModel, WhatFilename, RowId))
B4XTable1.SQL1.ExecNonQuery2("UPDATE data SET c1 = ?, c2 = ?, c3 = ?, c4 = ?, c5 = ?, c6 = ?, c7 = ?, c8 = ?, c9 = ? WHERE rowid = ?", Array As String(RowId, WhatRo, WhatDate, WhatFirstName, WhatLastName, WhatVin, WhatYear, WhatMake, WhatModel, WhatFilename))
B4XTable1.UpdateTableCounters
' Cursor1.Close
Catch
Msgbox2Async("The following error occurred" & Chr(10) & Chr(10) & LastException.Message, "Database Edit Error", "OK", "", "", LoadBitmap(File.DirAssets, "disclaimer.png"), True)
End Try
End Sub