Having trouble with some validation macro receiving a syntax error message. Can not figure out whats incorrect or missing.
Code: Select all
Sub validateBilling
oForm = ThisComponent.DrawPage.Forms.getByName("frmMain")
iValue = oForm.Columns.getByName("groupid").Value
msgbox " " & iValue
oConn = ThisDatabaseDocument.DataSource.getConnection("","")
dim SQL as object
dim myVar AS VARIANT
SQL=oConn.createStatement()
result=SQL.executeQuery("SELECT COUNT(""billto"") FROM ""tblmembers"" WHERE ""billto"" = true AND ""accID_fk"" = '" & iValue & '"" )
result.next
myVar = result.getInt(1)
msgbox " " & myVar