I’ve been looking everywhere but I can’t seem to find anything about this.
I have a table control named “tblAllCommodities” and I’m trying to populate its rows via macro. Here’s what I have so far:
Context = CreateUnoService("com.sun.star.sdb.DatabaseContext")
Db = Context.getByName("new project")
Conn = Db.getConnection("","")
strSQL = "SELECT * FROM [Commodities]"
Stmt = Conn.createStatement()
AllCommoditiesQuery = Stmt.executeQuery(strSQL)
AllCommoditiesQuery.next()
Dim tblAllCommodities as Variant
tblAllCommodities = mainForm.getByName("tblAllCommodities")
tblAllCommodities.data = AllCommoditiesQuery
Or maybe something like this is not possible via macro?
Thank you for your help.
Additional details:
-Certain high-level instructions restrict me from just simply binding the form to a query.
-The main objective is that the table control that I wanted to be filled with data, gets filled by a macro upon start of document.
============================
Version: 7.3.5.2 (x86) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_PH); UI: en-US
Calc: CL