I am stuck with variable not defined or insufficient rights.
LO 7.1.2 HSQL 2.51 on Win10
Cant figure the error in the statement trying to run an update using 2 variables.
Code: Select all
Sub moveItem
dim oForm1 as object
dim scurr
msgbox "Selected Item will be transferred to the location chosen"
oForm1=ThisComponent.Drawpage.Forms.act.Oselect.Area.SubDiv.qrfilter.getByName("tcq")
scurr = oForm1.getByName("sub_fk").currentvalue
'if not scurr Then
'Exit Sub
'End If
print " " & scurr
dim snew AS VARIANT
oConn = ThisDatabaseDocument.DataSource.getConnection("","")
SQL=oConn.createStatement()
result=SQL.executeQuery("SELECT ""ifrto"" FROM ""tblFilter""" )
result.next
snew = result.getInt(1)
msgbox " " & snew
oConn = ThisDatabaseDocument.DataSource.getConnection("","")
SQL=oConn.createStatement()
result=SQL.executeQuery("UPDATE ""tblInventory"" SET ""sub_fk"" = " & snew & "WHERE ""sub_fk"" = & scurr ")
msgbox "Item has been transferred successfully"
'reload forms
End Sub
Hope someone has a better eye, thanks