summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2013-10-12 10:56:41 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-10-13 23:28:26 +0000
commit350772317dd0bd226c33b1945f3801fcb146891b (patch)
tree616d7c9c389f1bc95f52094907c137c0c6827c91 /wizards
parent12b1ca3236aa167c007c6c87e0d2f2d06c495821 (diff)
Access2Base store (wizards + scp2)
License text modified after gerrit review Change-Id: I193d6d1fd477cca4c2880760f21f8d978643f634 Reviewed-on: https://gerrit.libreoffice.org/6232 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'wizards')
-rw-r--r--wizards/Module_wizards.mk1
-rw-r--r--wizards/Package_access2base.mk55
-rw-r--r--wizards/source/access2base/Application.xba1080
-rw-r--r--wizards/source/access2base/Collect.xba215
-rw-r--r--wizards/source/access2base/Compatible.xba47
-rw-r--r--wizards/source/access2base/Control.xba2185
-rw-r--r--wizards/source/access2base/DataDef.xba424
-rw-r--r--wizards/source/access2base/Database.xba523
-rw-r--r--wizards/source/access2base/Dialog.xba667
-rw-r--r--wizards/source/access2base/DoCmd.xba2034
-rw-r--r--wizards/source/access2base/Event.xba487
-rw-r--r--wizards/source/access2base/Field.xba738
-rw-r--r--wizards/source/access2base/Form.xba821
-rw-r--r--wizards/source/access2base/L10N.xba279
-rw-r--r--wizards/source/access2base/Methods.xba268
-rw-r--r--wizards/source/access2base/OptionGroup.xba300
-rw-r--r--wizards/source/access2base/PropertiesGet.xba1148
-rw-r--r--wizards/source/access2base/PropertiesSet.xba511
-rw-r--r--wizards/source/access2base/Property.xba134
-rw-r--r--wizards/source/access2base/Recordset.xba1053
-rw-r--r--wizards/source/access2base/SubForm.xba540
-rw-r--r--wizards/source/access2base/Test.xba19
-rw-r--r--wizards/source/access2base/Trace.xba415
-rw-r--r--wizards/source/access2base/Utils.xba647
-rw-r--r--wizards/source/access2base/_License.xba22
-rw-r--r--wizards/source/access2base/acConstants.xba346
-rw-r--r--wizards/source/access2base/dialog.xlb6
-rw-r--r--wizards/source/access2base/dlgFormat.xdl19
-rw-r--r--wizards/source/access2base/dlgTrace.xdl32
-rw-r--r--wizards/source/access2base/script.xlb28
-rw-r--r--wizards/source/configshare/dialog.xlc3
-rw-r--r--wizards/source/configshare/script.xlc1
32 files changed, 15047 insertions, 1 deletions
diff --git a/wizards/Module_wizards.mk b/wizards/Module_wizards.mk
index fd05f39d9243..0a7438a4e115 100644
--- a/wizards/Module_wizards.mk
+++ b/wizards/Module_wizards.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_Module_add_targets,wizards,\
AllLangResTarget_imp \
AllLangResTarget_tpl \
AllLangResTarget_wzi \
+ Package_access2base \
Package_depot \
Package_euro \
Package_form \
diff --git a/wizards/Package_access2base.mk b/wizards/Package_access2base.mk
new file mode 100644
index 000000000000..d6a0e17242bf
--- /dev/null
+++ b/wizards/Package_access2base.mk
@@ -0,0 +1,55 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+
+$(eval $(call gb_Package_Package,wizards_basicsrvaccess2base,$(SRCDIR)/wizards/source/access2base))
+
+$(eval $(call gb_Package_set_outdir,wizards_basicsrvaccess2base,$(INSTROOT)))
+
+$(eval $(call gb_Package_add_files,wizards_basicsrvaccess2base,$(LIBO_SHARE_FOLDER)/basic/Access2Base,\
+ _License.xba \
+ acConstants.xba \
+ Application.xba \
+ Collect.xba \
+ Compatible.xba \
+ Control.xba \
+ Database.xba \
+ DataDef.xba \
+ Dialog.xba \
+ dialog.xlb \
+ dlgFormat.xdl \
+ dlgTrace.xdl \
+ DoCmd.xba \
+ Event.xba \
+ Field.xba \
+ Form.xba \
+ L10N.xba \
+ Methods.xba \
+ OptionGroup.xba \
+ PropertiesGet.xba \
+ PropertiesSet.xba \
+ Property.xba \
+ Recordset.xba \
+ script.xlb \
+ SubForm.xba \
+ Test.xba \
+ Trace.xba \
+ Utils.xba \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba
new file mode 100644
index 000000000000..680c546f13b6
--- /dev/null
+++ b/wizards/source/access2base/Application.xba
@@ -0,0 +1,1080 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Application" script:language="StarBasic">Option Explicit
+
+&apos;DATABASE
+&apos; Name property
+&apos; Path property
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const TRACEDEBUG = &quot;DEBUG&quot; &apos; To report values of variables
+Global Const TRACEINFO = &quot;INFO&quot; &apos; To report any event
+Global Const TRACEWARNING = &quot;WARNING&quot; &apos; To report some abnormal event
+Global Const TRACEERRORS = &quot;ERROR&quot; &apos; To report user errors - Default value
+Global Const TRACEFATAL = &quot;FATAL&quot; &apos; To report programmer errors - f.i. Wrong argument
+Global Const TRACEABORT = &quot;ABORT&quot; &apos; To report Access2Base internal errors
+Global Const TRACEANY = &quot;===&gt;&quot; &apos; Always reported
+ &apos; ERRORs, FATALs and ABORTs are also displayed in a MsgBox (except on specific request)
+ &apos; FATALs and ABORTs interrupt the program execution
+
+Global Const ERRINIT = 1500
+Global Const ERRNOTDATABASE = 1501
+Global Const ERRDBNOTCONNECTED = 1502
+Global Const ERRMISSINGARGUMENTS = 1503
+Global Const ERRWRONGARGUMENT = 1504
+Global Const ERRMAINFORM = 1505
+Global Const ERRSTANDALONE = 1506
+Global Const ERRFORMNOTIDENTIFIED = 1507
+Global Const ERRFORMNOTFOUND = 1508
+Global Const ERRFORMNOTOPEN = 1509
+Global Const ERRDFUNCTION = 1510
+Global Const ERROPENFORM = 1511
+Global Const ERRPROPERTY = 1512
+Global Const ERRPROPERTYVALUE = 1513
+Global Const ERRINDEXVALUE = 1514
+Global Const ERRCOLLECTION = 1515
+Global Const ERRPROPERTYNOTARRAY = 1516
+Global Const ERRCONTROLNOTFOUND = 1517
+Global Const ERRNOACTIVEFORM = 1518
+Global Const ERRDATABASEFORM = 1519
+Global Const ERRFOCUSINGRID = 1520
+Global Const ERRNOGRIDINFORM = 1521
+Global Const ERRFINDRECORD = 1522
+Global Const ERRSQLSTATEMENT = 1523
+Global Const ERROBJECTNOTFOUND = 1524
+Global Const ERROPENOBJECT = 1525
+Global Const ERRCLOSEOBJECT = 1526
+Global Const ERRMETHOD = 1527
+Global Const ERRACTION = 1528
+Global Const ERRSENDMAIL = 1529
+Global Const ERRFORMYETOPEN = 1530
+Global Const ERRMETHOD = 1531
+Global Const ERRPROPERTYINIT = 1532
+Global Const ERRFILENOTCREATED = 1533
+Global Const ERRDIALOGNOTFOUND = 1534
+Global Const ERRDIALOGUNDEFINED = 1535
+Global Const ERRDIALOGSTARTED = 1536
+Global Const ERRDIALOGNOTSTARTED = 1537
+Global Const ERRRECORDSETNODATA = 1538
+Global Const ERRRECORDSETCLOSED = 1539
+Global Const ERRRECORDSETRANGE = 1540
+Global Const ERRRECORDSETFORWARD = 1541
+Global Const ERRFIELDNULL = 1542
+Global Const ERRFILEACCESS = 1543
+Global Const ERRMEMOLENGTH = 1544
+Global Const ERRNOTACTIONQUERY = 1545
+Global Const ERRNOTUPDATABLE = 1546
+Global Const ERRUPDATESEQUENCE = 1547
+Global Const ERRNOTNULLABLE = 1548
+Global Const ERRROWDELETED = 1549
+Global Const ERRRECORDSETCLONE = 1550
+Global Const ERRQUERYDEFDELETED = 1551
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const COLLALLDIALOGS = &quot;ALLDIALOGS&quot;
+Global Const COLLALLFORMS = &quot;ALLFORMS&quot;
+Global Const COLLCONTROLS = &quot;CONTROLS&quot;
+Global Const COLLFORMS = &quot;FORMS&quot;
+Global Const COLLFIELDS = &quot;FIELDS&quot;
+Global Const COLLPROPERTIES = &quot;PROPERTIES&quot;
+Global Const COLLQUERYDEFS = &quot;QUERYDEFS&quot;
+Global Const COLLRECORDSETS = &quot;RECORDSETS&quot;
+Global Const COLLTABLEDEFS = &quot;TABLEDEFS&quot;
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const OBJAPPLICATION = &quot;APPLICATION&quot;
+Global Const OBJCOLLECTION = &quot;COLLECTION&quot;
+Global Const OBJCONTROL = &quot;CONTROL&quot;
+Global Const OBJDATABASE = &quot;DATABASE&quot;
+Global Const OBJDIALOG = &quot;DIALOG&quot;
+Global Const OBJEVENT = &quot;EVENT&quot;
+Global Const OBJFIELD = &quot;FIELD&quot;
+Global Const OBJFORM = &quot;FORM&quot;
+Global Const OBJOPTIONGROUP = &quot;OPTIONGROUP&quot;
+Global Const OBJPROPERTY = &quot;PROPERTY&quot;
+Global Const OBJQUERYDEF = &quot;QUERYDEF&quot;
+Global Const OBJRECORDSET = &quot;RECORDSET&quot;
+Global Const OBJSUBFORM = &quot;SUBFORM&quot;
+Global Const OBJTABLEDEF = &quot;TABLEDEF&quot;
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const CTLCONTROL = &quot;CONTROL&quot; &apos; ClassId
+Global Const CTLCHECKBOX = &quot;CHECKBOX&quot; &apos; 5
+Global Const CTLCOMBOBOX = &quot;COMBOBOX&quot; &apos; 7
+Global Const CTLCOMMANDBUTTON = &quot;COMMANDBUTTON&quot; &apos; 2
+Global Const CTLCURRENCYFIELD = &quot;CURRENCYFIELD&quot; &apos; 18
+Global Const CTLDATEFIELD = &quot;DATEFIELD&quot; &apos; 15
+Global Const CTLFILECONTROL = &quot;FILECONTROL&quot; &apos; 12
+Global Const CTLFIXEDTEXT = &quot;FIXEDTEXT&quot; &apos; 10
+Global Const CTLGRIDCONTROL = &quot;GRIDCONTROL&quot; &apos; 11
+Global Const CTLGROUPBOX = &quot;GROUPBOX&quot; &apos; 8
+Global Const CTLHIDDENCONTROL = &quot;HIDDENCONTROL&quot; &apos; 13
+Global Const CTLIMAGEBUTTON = &quot;IMAGEBUTTON&quot; &apos; 4
+Global Const CTLIMAGECONTROL = &quot;IMAGECONTROL&quot; &apos; 14
+Global Const CTLLISTBOX = &quot;LISTBOX&quot; &apos; 6
+Global Const CTLNAVIGATIONBAR = &quot;NAVIGATIONBAR&quot; &apos; 22
+Global Const CTLNUMERICFIELD = &quot;NUMERICFIELD&quot; &apos; 17
+Global Const CTLPATTERNFIELD = &quot;PATTERNFIELD&quot; &apos; 19
+Global Const CTLRADIOBUTTON = &quot;RADIOBUTTON&quot; &apos; 3
+Global Const CTLSCROLLBAR = &quot;SCROLLBAR&quot; &apos; 20
+Global Const CTLSPINBUTTON = &quot;SPINBUTTON&quot; &apos; 21
+Global Const CTLTEXTFIELD = &quot;TEXTFIELD&quot; &apos; 9
+Global Const CTLTIMEFIELD = &quot;TIMEFIELD&quot; &apos; 16
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const CTLFORMATTEDFIELD = &quot;FORMATTEDFIELD&quot; &apos; 9 (idem TextField)
+Global Const CTLFIXEDLINE = &quot;FIXEDLINE&quot; &apos; 24 (forced)
+Global Const CTLPROGRESSBAR = &quot;PROGRESSBAR&quot; &apos; 23 (forced)
+Global Const CTLSUBFORM = &quot;SUBFORMCONTROL&quot; &apos; None
+REM -----------------------------------------------------------------------------------------------------------------------
+Global Const CTLPARENTISFORM = &quot;FORM&quot;
+Global Const CTLPARENTISDIALOG = &quot;DIALOG&quot;
+Global Const CTLPARENTISSUBFORM = &quot;SUBFORM&quot;
+Global Const CTLPARENTISGRID = &quot;GRID&quot;
+Global Const CTLPARENTISGROUP = &quot;OPTIONGROUP&quot;
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Type Root
+ &apos; Single values
+ ErrorHandler As Boolean
+ MinimalTraceLevel As Integer
+ TraceLogs() As Variant
+ TraceLogCount As Integer
+ TraceLogLast As Integer
+ TraceLogMaxEntries As Integer
+ CalledSub As String
+ Introspection As Object &apos; com.sun.star.beans.Introspection
+ VersionNumber As String &apos; Actual Access2Base version number
+ CurrentDb() As Object &apos; Array of database objects -{0] = Base file, [1..N] = Writer files
+End Type
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function AllDialogs(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return either a Collection or a Dialog object
+&apos; The dialogs are selected only if library is loaded
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Const cstThisSub = &quot;AllDialogs&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+Dim iMode As Integer, vDialogs() As Variant, i As Integer, j As Integer, iCount As Integer
+Dim oMacLibraries As Object, vAllDialogs As Variant, oLibrary As Object, vNames() As Variant, bFound As Boolean
+Dim oLibDialog As Object, sLibrary As String, oDocLibraries As Object
+Dim vLibraries() As Variant, vMacLibraries() As Variant, vDocLibraries() As Variant, oDocMacLib As Object
+Const cstCount = 0
+Const cstByIndex = 1
+Const cstByName = 2
+Const cstSepar = &quot;!&quot;
+
+ If IsMissing(pvIndex) Then
+ iMode = cstCount
+ Else
+ If Not Utils.Utils._CheckArgument(pvIndex, 1, Utils.Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ If VarType(pvIndex) = vbString Then iMode = cstByName Else iMode = cstByIndex
+ End If
+
+ Set vAllDialogs = Nothing
+
+ Set oDocLibraries = ThisComponent.DialogLibraries &apos;_CurrentDb().Document.DialogLibraries
+ vDocLibraries = oDocLibraries.getElementNames()
+ Set oMacLibraries = DialogLibraries
+ vMacLibraries = oMacLibraries.getElementNames()
+ &apos;Remove Access2Base from the list
+ For i = 0 To UBound(vMacLibraries)
+ If vMacLibraries(i) = &quot;Access2Base&quot; Then vMacLibraries(i) = &quot;&quot;
+ Next i
+ vMacLibraries = Utils._TrimArray(vMacLibraries)
+
+ If UBound(vDocLibraries) + UBound(vMacLibraries) &lt; 0 Then &apos; No library
+ Set vAllDialogs = New Collect
+ vAllDialogs._CollType = COLLALLDIALOGS
+ vAllDialogs._ParentType = OBJAPPLICATION
+ vAllDialogs._ParentName = &quot;&quot;
+ vAllDialogs._Count = 0
+ Goto Exit_Function
+ End If
+
+ vNames = Array()
+ iCount = 0
+ For i = 0 To UBound(vDocLibraries) + UBound(vMacLibraries) + 1
+ bFound = False
+ If i &lt;= UBound(vDocLibraries) Then
+ sLibrary = vDocLibraries(i)
+ Set oDocMacLib = oDocLibraries
+ &apos; Sometimes library not loaded as should ??
+ If Not oDocMacLib.IsLibraryLoaded(sLibrary) Then oDocMacLib.loadLibrary(sLibrary)
+ Else
+ sLibrary = vMacLibraries(i - UBound(vDocLibraries) - 1)
+ Set oDocMacLib = oMacLibraries
+ End If
+ If oDocMacLib.IsLibraryLoaded(sLibrary) Then
+ Set oLibrary = oDocMacLib.getByName(sLibrary)
+ If oLibrary.hasElements() Then
+ vDialogs = oLibrary.getElementNames()
+ Select Case iMode
+ Case cstCount
+ iCount = iCount + UBound(vDialogs) + 1
+ Case cstByIndex, cstByName
+ For j = 0 To UBound(vDialogs)
+ If iMode = cstByIndex Then
+ If pvIndex = iCount Then bFound = True
+ iCount = iCount + 1
+ Else
+ If UCase(pvIndex) = UCase(vDialogs(j)) Then bFound = True
+ End If
+ If bFound Then
+ Set oLibDialog = oLibrary.getByName(vDialogs(j)) &apos; Create Dialog object
+ Exit For
+ End If
+ Next j
+ End Select
+ End If
+ End If
+ If bFound Then Exit For
+ Next i
+
+ If iMode = cstCount Then
+ Set vAllDialogs = New Collect
+ vAllDialogs._CollType = COLLALLDIALOGS
+ vAllDialogs._ParentType = OBJAPPLICATION
+ vAllDialogs._ParentName = &quot;&quot;
+ vAllDialogs._Count = iCount
+ Else
+ If Not bFound Then
+ If iMode = cstByIndex Then Goto Trace_Error_Index Else Goto Trace_Not_Found
+ End If
+ Set vAllDialogs = New Dialog
+ vAllDialogs._Name = vDialogs(j)
+ vAllDialogs._Shortcut = &quot;Dialogs!&quot; &amp; vDialogs(j)
+ Set vAllDialogs._Dialog = oLibDialog
+ End If
+
+Exit_Function:
+ Set AllDialogs = vAllDialogs
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Not_Found:
+ TraceError(TRACEFATAL, ERRDIALOGNOTFOUND, Utils.Utils._CalledSub(), 0, , pvIndex)
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set vDialogs = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ Set vDialogs = Nothing
+ GoTo Exit_Function
+End Function &apos; AllDialogs V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function AllForms(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return an object of type Form indicated by either its index (integer) or its name (NOT CASE-SENSITIVE string)
+&apos; Easiest use for standalone forms: AllForms(0)
+&apos; If no argument, return a Collection type
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+Const cstThisSub = &quot;AllForms&quot;
+ Utils._SetCalledSub(cstThisSub)
+Dim iIndex As Integer, vAllForms As Variant
+ Set vAllForms = Nothing
+
+ If Not IsMissing(pvIndex) Then
+ If Not Utils.Utils._CheckArgument(pvIndex, 1, Utils.Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ Select Case VarType(pvIndex)
+ Case vbString
+ iIndex = -1
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ iIndex = pvIndex
+ End Select
+ End If
+
+Dim oDatabase As Variant, oForms As Variant, oCounter As Variant, oFormsCollection As Object
+ Set oDatabase = _CurrentDb()
+ If Not oDatabase._Standalone Then Set oForms = oDatabase.Document.getFormDocuments()
+&apos; Process when NO ARGUMENT
+ If IsMissing(pvIndex) Then &apos; No argument
+ Set oCounter = New Collect
+ oCounter._CollType = COLLALLFORMS
+ oCounter._ParentType = OBJAPPLICATION
+ oCounter._ParentName = &quot;&quot;
+ If oDatabase._Standalone Then oCounter._Count = 1 Else oCounter._Count = oForms.getCount()
+ Set vAllForms = oCounter
+ Goto Exit_Function
+ End If
+
+&apos; Process when ARGUMENT = STRING or INDEX =&gt; Initialize form object
+Dim ofForm As Object
+ Set ofForm = New Form
+Dim sAllForms As Variant, i As Integer, sSub As String, vName As Variant
+ Select Case oDatabase._Standalone
+ Case False
+ sAllForms() = oForms.getElementNames()
+ If iIndex= -1 Then &apos; String argument
+ vName = Utils._InList(Utils.Utils._Trim(pvIndex), sAllForms, True) &apos; hasByName not used because case sensitive
+ If vName = False Then Goto Trace_Not_Found
+ ofForm._Initialize(vName)
+ Else
+ If iIndex + 1 &gt; oForms.getCount() Or iIndex &lt; 0 Then Goto Trace_Error_Index &apos; Numeric argument OK but value nonsense
+ ofForm._Initialize(sAllForms(iIndex))
+ End If
+ Case True
+ If iIndex = -1 Then
+ If UCase(Utils.Utils._Trim(pvIndex)) &lt;&gt; UCase(oDatabase.FormName) Then Goto Trace_Not_Found
+ ElseIf iIndex &lt;&gt; 0 Then
+ Goto Trace_Error_Index
+ End If
+ vName = oDatabase.FormName
+ ofForm._Initialize(vName)
+ End Select
+
+ Set vAllForms = ofForm
+
+Exit_Function:
+ Set AllForms = vAllForms
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Not_Found:
+ TraceError(TRACEFATAL, ERRFORMNOTFOUND, Utils._CalledSub(), 0, , pvIndex)
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set vAllForms = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ Set vAllForms = Nothing
+ GoTo Exit_Function
+End Function &apos; AllForms V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Controls(ByVal Optional pvObject As Variant, Optional ByVal pvIndex As Variant) As Variant
+&apos; Return an object of type Control indicated by either its index (integer) or its name (CASE-INSENSITIVE string)
+&apos; The 1st argument pvObject can be either
+&apos; an object of type FORM (1)
+&apos; a main form name as string
+&apos; an object of type SUBFORM (2)
+&apos; The Form property in the returned variant contains a SUBFORM type
+&apos; an object of type CONTROL and subtype GRIDCONTROL (3)
+&apos; an object of type OPTIONGROUP (4) 2nd argument, if any, must be numeric
+&apos; If no pvIndex argument, return a Collection type
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim vObject As Object, vEMPTY As variant
+Const cstThisSub = &quot;Controls&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+ If IsMissing(pvObject) Then Call _TraceArguments()
+ If IsNull(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments()
+ Controls = vEMPTY
+
+ If VarType(pvObject) = vbString Then
+ Set vObject = Forms(pvObject)
+ If IsNull(vObject) Then Goto Exit_Function
+ Else
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJSUBFORM, OBJOPTIONGROUP, CTLGRIDCONTROL)) Then Goto Exit_Function
+ Set vObject = pvObject
+ End If
+
+ If IsMissing(pvIndex) Then
+ Controls = vObject.Controls()
+ Else
+ If Not Utils._CheckArgument(pvIndex, 2, Utils.Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ Controls = vObject.Controls(pvIndex)
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEERROR, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function &apos; Controls V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function CurrentDb(Optional pvURL As String) As Object
+&apos; Returns _A2B_.CurrentDb(.) as an object to allow access to its properties
+&apos; Parameter only for internal use
+
+Const cstThisSub = &quot;CurrentDb&quot;
+ Utils._SetCalledSub(cstThisSub)
+Dim i As Integer, bFound As Boolean, sURL As String, oCurrent As Object
+
+ bFound = False
+ Set CurrentDb = Nothing
+ With _A2B_
+ If Not IsArray(.CurrentDb) Then Goto Exit_Function
+ If UBound(.CurrentDb) &lt; 0 Then Goto Exit_Function
+ For i = 1 To UBound(.CurrentDb) &apos; [0] reserved to database .odb document
+ Set oCurrent = .CurrentDb(i)
+ If IsMissing(pvURL) Then &apos; Not on 1 single line ?!?
+ If Utils.Utils._hasUNOProperty(ThisComponent, &quot;URL&quot;) Then
+ sURL = ThisComponent.URL
+ Else
+ Exit For &apos; f.i. ThisComponent = Basic IDE ...
+ End If
+ Else
+ sURL = pvURL &apos; To support the SelectObject action
+ End If
+ If .CurrentDb(i).URL = sURL Then
+ Set CurrentDb = oCurrent
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then
+ If Not IsNull(.CurrentDb(0)) Then Set CurrentDb = .CurrentDb(0)
+ End If
+ End With
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; CurrentDb V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function CurrentUser() As String
+
+Const cstWindows = 1
+Const cstUnix = 4
+ Select Case GetGuiType()
+ Case cstWindows
+ CurrentUser = Environ(&quot;USERNAME&quot;)
+ Case cstUnix
+ CurrentUser = Environ(&quot;USER&quot;)
+ Case Else
+ CurrentUser = &quot;&quot;
+ End Select
+
+End Function &apos; CurrentUser V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DAvg( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return average of scope
+Const cstThisSub = &quot;DAvg&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DAvg = Application._DFunction(&quot;AVG&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DAvg
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DCount( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return # of occurrences of scope
+Const cstThisSub = &quot;DCount&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DCount = Application._DFunction(&quot;COUNT&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DCount
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DLookup( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ , ByVal Optional pvOrderClause As Variant _
+ ) As Variant
+
+&apos; Return a value within a table
+ &apos;Arguments: psExpr: an SQL expression
+ &apos; psDomain: a table- or queryname
+ &apos; pvCriteria: an optional WHERE clause
+ &apos; pcOrderClause: an optional order clause incl. &quot;DESC&quot; if relevant
+ &apos;Return: Value of the psExpr if found, else Null.
+ &apos;Author: inspired from Allen Browne. http://allenbrowne.com/ser-42.html
+ &apos;Examples:
+ &apos; 1. To find the last value, include DESC in the OrderClause, e.g.:
+ &apos; DLookup(&quot;[Surname] &amp; [FirstName]&quot;, &quot;tblClient&quot;, , &quot;ClientID DESC&quot;)
+ &apos; 2. To find the lowest non-null value of a field, use the Criteria, e.g.:
+ &apos; DLookup(&quot;ClientID&quot;, &quot;tblClient&quot;, &quot;Surname Is Not Null&quot; , &quot;Surname&quot;)
+
+Const cstThisSub = &quot;DLookup&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DLookup = Application._DFunction(&quot;&quot;, psExpr, psDomain _
+ , Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria) _
+ , Iif(IsMissing(pvOrderClause), &quot;&quot;, pvOrderClause) _
+ )
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DLookup
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DMax( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return maximum of scope
+Const cstThisSub = &quot;DMax&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DMax = Application._DFunction(&quot;MAX&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DMax
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DMin( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return minimum of scope
+Const cstThisSub = &quot;DMin&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DMin = Application._DFunction(&quot;MIN&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DMin
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DStDev( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return standard deviation of scope
+Const cstThisSub = &quot;DStDev&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DStDev = Application._DFunction(&quot;STDDEV_SAMP&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;) &apos; STDDEV not STDEV !
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DStDev
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DStDevP( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return standard deviation of scope
+Const cstThisSub = &quot;DStDevP&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DStDevP = Application._DFunction(&quot;STDDEV_POP&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;) &apos; STDDEV not STDEV !
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DStDevP
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DSum( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return sum of scope
+Const cstThisSub = &quot;DSum&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DSum = Application._DFunction(&quot;SUM&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DSum
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DVar( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return variance of scope
+Const cstThisSub = &quot;DVar&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DVar = Application._DFunction(&quot;VAR_SAMP&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DVar
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function DVarP( _
+ ByVal Optional psExpr As String _
+ , ByVal Optional psDomain As String _
+ , ByVal Optional pvCriteria As Variant _
+ ) As Variant
+&apos; Return variance of scope
+Const cstThisSub = &quot;DVarP&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(psExpr) Or IsMissing(psDomain) Then Call _TraceArguments()
+ DVarP = Application._DFunction(&quot;VAR_POP&quot;, psExpr, psDomain, Iif(IsMissing(pvCriteria), &quot;&quot;, pvCriteria), &quot;&quot;)
+ Utils._ResetCalledSub(cstThisSub)
+End Function &apos; DVarP
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Events(Optional poEvent As Variant) As Variant
+&apos; Return an event object corresponding with actual event
+
+Dim vEvent As Variant
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Const cstThisSub = &quot;Events&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+ Set vEvent = Nothing
+ If IsMissing(poEvent) Then Goto Exit_Function
+ If IsNull(poEvent) Then Goto Exit_Function
+
+ If Not Utils.Utils._hasUNOProperty(poEvent, &quot;Source&quot;) Then Goto Trace_Error
+ Set vEvent = New Event
+ vEvent._Initialize(poEvent)
+
+Exit_Function:
+ Set Events = vEvent
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEWARNING, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Trace_Error:
+ &apos; Errors are not displayed to avoid display infinite cycling
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, False, Utils.Utils._CStr(poEvent))
+ Set vEvent = Nothing
+ Goto Exit_Function
+End Function &apos; Events V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Forms(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return an object of type Form indicated by either its index (integer) or its name (NOT CASE-SENSITIVE string)
+&apos; The concerned form must be loaded.
+&apos; If no argument, return a Collection type
+
+Const cstThisSub = &quot;Forms&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+Dim ofForm As Object, oCounter As Variant, vForms As Variant, oIndex As Object
+ Set vForms = Nothing
+
+Dim iCount As Integer
+ If IsMissing(pvIndex) Then
+ iCount = Application._CountOpenForms()
+ Set oCounter = New Collect
+ oCounter._CollType = COLLFORMS
+ oCounter._ParentType = OBJAPPLICATION
+ oCounter._ParentName = &quot;&quot;
+ oCounter._Count = iCount
+ Forms = oCounter
+ Exit Function
+ Else
+ If Not Utils._CheckArgument(pvIndex, 1, Utils.Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+ Select Case VarType(pvIndex)
+ Case vbString
+ Set ofForm = Application.AllForms(Utils.Utils._Trim(pvIndex))
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ iCount = Application._CountOpenForms()
+ If iCount &lt;= pvIndex Then Goto Trace_Error_Index
+ Set ofForm = Application._CountOpenForms(pvIndex)
+ Case Else
+ End Select
+
+ If IsNull(ofForm) Then Goto Trace_Error
+ If ofForm.IsLoaded Then
+ Set vForms = ofForm
+ Else
+ Set vForms = Nothing
+ TraceError(TRACEFATAL, ERRFORMNOTOPEN, Utils._CalledSub(), 0, , ofForm._Name)
+ Goto Exit_Function
+ End If
+
+Exit_Function:
+ Set Forms = vForms
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , 1)
+ Set vForms = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set vForms = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function &apos; Forms V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub OpenConnection ( _
+ Optional pvComponent As Variant _
+ , ByVal Optional pvUser As Variant _
+ , ByVal Optional pvPassword As Variant _
+ )
+
+&apos; Establish connection with the database designated in the currently open front-end (.odb) document
+&apos; Call template:
+&apos; Call OpenConnection(ThisDatabaseDocument[, &quot;&quot;, &quot;&quot;])
+&apos; Call stored in the OpenDocument event of the front-end database document
+&apos;OR
+&apos; Initiates processing of a standalone (Writer) form (V0.8.0)
+&apos; Call template:
+&apos; Call OpenConnection(ThisComponent[, &quot;&quot;, &quot;&quot;])
+&apos; Call stored in the OpenDocument event of the standalone form
+
+Dim odbDatabase As Variant, oComponent As Object, oForm As Object, iCurrent As Integer
+Dim i As Integer, bFound As Boolean
+Dim vCurrentDb() As Variant
+
+ If IsEmpty(_A2B_) Then Call Application._RootInit() &apos; First use of Access2Base in current AOO/LibO session
+
+ If _ErrorHandler() Then On Local Error Goto Error_Sub
+Const cstThisSub = &quot;OpenConnection&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvComponent) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvComponent, 1, vbObject) Then Goto Exit_Sub
+ Set oComponent = pvComponent
+ If Not Utils._hasUNOProperty(oComponent, &quot;ImplementationName&quot;) Then
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, 1)
+ Exit Sub
+ End If
+ If IsMissing(pvUser) Then pvUser = &quot;&quot;
+ If IsMissing(pvPassword) Then pvPassword = &quot;&quot;
+ If Not Utils._CheckArgument(pvUser, 2, vbString) Then Goto Exit_Sub
+ If Not Utils._CheckArgument(pvPassword, 3, vbString) Then Goto Exit_Sub
+
+ If Not IsArray(_A2B_.CurrentDb) Then vCurrentDb = Array() Else vCurrentDb = _A2B_.CurrentDb
+
+ Set odbDatabase = New Database
+ Select Case oComponent.ImplementationName
+ Case &quot;com.sun.star.comp.dba.ODatabaseDocument&quot;
+ If Not oComponent.CurrentController.IsConnected Then oComponent.CurrentController.Connect(pvUser, pvPassword)
+ Set odbDatabase.Connection = oComponent.CurrentController.ActiveConnection
+ odbDatabase._Standalone = False
+ Case &quot;SwXTextDocument&quot;
+ Set oForm = oComponent.CurrentController.Model.DrawPage.Forms
+ If oForm.Count &lt;&gt; 1 Then Goto Error_MainForm
+ odbDatabase.FormName = oForm.ElementNames(0)
+ odbDatabase.Form = oForm.getByName(odbDatabase.FormName)
+ Set odbDatabase.Connection = odbDatabase.Form.ActiveConnection
+ odbDatabase._Standalone = True
+ Case Else
+ TraceError(TRACEFATAL, ERRNOTDATABASE, Utils._CalledSub(), 0, , 1)
+ End Select
+
+ If Not IsNull(odbDatabase.Connection) Then &apos; Null when standalone and target db does not exist
+ Set odbDatabase.MetaData = odbDatabase.Connection.MetaData
+ End If
+ Set odbDatabase.Document = oComponent
+ odbDatabase.Title = oComponent.Title
+ odbDatabase.URL = oComponent.URL
+
+ If UBound(vCurrentDb) &lt; 0 Then &apos; NOT ON 1 SINGLE LINE !!!
+ Redim vCurrentDb(0 To 0)
+ End If
+
+ Select Case odbDatabase._Standalone &apos; Find entry to use for new connection
+ Case True
+ If UBound(vCurrentDb) &lt;= 0 Then
+ iCurrent = 1
+ Else &apos; Search entry already used earlier by same component
+ bFound = False
+ For i = 1 To UBound(vCurrentDb)
+ If Not IsEmpty(vCurrentDb(i)) Then
+ If vCurrentDb(i)._Standalone And vCurrentDb(i).URL = odbDatabase.URL Then
+ iCurrent = i
+ bFound = True
+ Exit For
+ End If
+ End If
+ Next i
+ End If
+ If Not bFound Then
+ iCurrent = UBound(vCurrentDb) + 1 &apos; No entry found, increment array
+ ReDim Preserve vCurrentDb(0 To iCurrent)
+ End If
+ Set vCurrentDb(iCurrent) = odbDatabase
+ Case False
+ Set vCurrentDb(0) = odbDatabase
+ End Select
+
+ _A2B_.CurrentDb = vCurrentDb
+
+ TraceLog(TRACEANY, Utils._GetProductName() &amp; &quot; - Access2Base &quot; &amp; _A2B_.VersionNumber, False)
+ If IsNull(odbDatabase.Connection) Then Goto Trace_Error
+ TraceLog(TRACEANY, odbDatabase.MetaData.getDatabaseProductName() &amp; &quot; &quot; &amp; odbDatabase.MetaData.getDatabaseProductVersion, False)
+
+Exit_Sub:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Sub
+Error_Sub:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ Set _A2B_.CurrentDb = Array()
+ GoTo Exit_Sub
+Error_MainForm:
+ TraceError(TRACEFATAL, ERRMAINFORM, Utils._CalledSub(), False, ,oComponent.Title)
+ Set _A2B_.CurrentDb = Array()
+ GoTo Exit_Sub
+Trace_Error:
+ TraceError(TRACEABORT, ERRDBNOTCONNECTED, Utils._CalledSub(), 0,1)
+ Goto Exit_Sub
+End Sub &apos; OpenConnection V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function ProductCode()
+ ProductCode = &quot;Access2Base &quot; &amp; _A2B_.VersionNumber
+End Function &apos; ProductCode V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function SysCmd(Optional pvAction As Variant _
+ , Optional pvText As Variant _
+ , Optional pvValue As Variant _
+ ) As Variant
+&apos; Manage progress meter in the status bar
+&apos; Other values supported by MSAccess are ignored
+
+Const cstThisSub = &quot;SysCmd&quot;
+ Utils._SetCalledSub(cstThisSub)
+ SysCmd = False
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+Const cstMissing = -1
+Const cstBarLength = 350
+ If IsMissing(pvAction) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvAction, 1, Utils.Utils._AddNumeric(), Array( _
+ acSysCmdAccessDir _
+ , acSysCmdAccessVer _
+ , acSysCmdClearHelpTopic _
+ , acSysCmdClearStatus _
+ , acSysCmdGetObjectState _
+ , acSysCmdGetWorkgroupFile _
+ , acSysCmdIniFile _
+ , acSysCmdInitMeter _
+ , acSysCmdProfile _
+ , acSysCmdRemoveMeter _
+ , acSysCmdRuntime _
+ , acSysCmdSetStatus _
+ , acSysCmdUpdateMeter _
+ )) Then Goto Exit_Function
+ If IsMissing(pvValue) Then pvValue = cstMissing
+ If Not Utils._CheckArgument(pvAction, 1, Utils.Utils._AddNumeric()) Then Goto Exit_Function
+ Select Case pvAction
+ Case acSysCmdInitMeter, acSysCmdUpdateMeter, acSysCmdSetStatus
+ If IsMissing(pvText) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvText, 2, vbString) Then Goto Exit_Function
+ Case Else
+ End Select
+ If Not Utils._CheckArgument(pvValue, 3, Utils._AddNumeric()) Then Goto Exit_Function
+
+Dim vBar As Variant, oDb As Object, iLen As Integer
+ Set oDb = _CurrentDb()
+ Set vBar = oDb.StatusBar
+ Select Case pvAction
+ Case acSysCmdAccessVer
+ SysCmd = Application.Version()
+ Goto Exit_Function
+ Case acSysCmdSetStatus
+ If pvValue &lt;&gt; cstMissing Then Goto Error_Arg
+ iLen = Len(pvText)
+ vBar = _NewBar()
+ If Not IsNull(vBar) Then vBar.start(Iif(iLen &gt;= cstBarLength, pvText, pvText &amp; Space(cstBarLength - iLen)), 0)
+ Case acSysCmdClearStatus
+ If pvValue &lt;&gt; cstMissing Then Goto Error_Arg
+ If Not IsNull(vBar) Then
+ vBar.end()
+ Set oDb.StatusBar = Nothing
+ End If
+ Case acSysCmdInitMeter
+ If pvValue = cstMissing Then Call _TraceArguments()
+ vBar = _NewBar()
+ If Not IsNull(vBar) Then vBar.start(pvText, pvValue)
+ Case acSysCmdUpdateMeter
+ If pvValue = cstMissing Then Call _TraceArguments()
+ If Not IsNull(vBar) Then &apos; Otherwise ignore !
+ vBar.setValue(pvValue)
+ If Len(pvText) &gt; 0 Then vBar.setText(pvText)
+ End If
+ Case acSysCmdRemoveMeter
+ If Not IsNull(vBar) Then
+ vBar.end()
+ Set oDb.StatusBar = Nothing
+ End If
+ Case acSysCmdRuntime
+ SysCmd = False
+ Goto Exit_Function
+ Case Else
+ End Select
+
+ SysCmd = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_Arg:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(3, pvValue))
+ Goto Exit_Function
+End Function &apos; SysCmd V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Version() As String
+ Version = Utils._GetProductName()
+End Function &apos; Version V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _CountOpenForms(ByVal Optional piCountMax As Integer) As Variant
+&apos; Return # of active forms if no argument
+&apos; Return name of piCountMax-th open form if argument present
+
+Dim i As Integer, iCount As Integer, iAllCount As Integer, ofForm As Variant
+ iAllCount = AllForms._Count
+ iCount = 0
+ If iAllCount &gt; 0 Then
+ Set ofForm = New Form
+ For i = 0 To iAllCount - 1
+ Set ofForm = Application.AllForms(i)
+ If ofForm.IsLoaded Then iCount = iCount + 1
+ If Not IsMissing(piCountMax) Then
+ If iCount = piCountMax + 1 Then
+ _CountOpenForms = ofForm &apos; OO3.2 aborts when Set verb present ?!?
+ Exit For
+ End If
+ End If
+ Next i
+ End If
+
+ If IsMissing(piCountMax) Then _CountOpenForms = iCount
+
+End Function &apos; CountOpenForms V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _CurrentDb() As Variant
+REM Same as CurrentDb() except that it generates an error if database not connected (internal use)
+
+Dim odbDatabase As Variant
+ Set odbDatabase = Application.CurrentDb()
+ If IsNull(odbDatabase) Then GoTo Trace_Error
+
+Exit_Function:
+ Set _CurrentDb = odbDatabase
+ Exit Function
+Trace_Error:
+ TraceError(TRACEABORT, ERRDBNOTCONNECTED, Utils._CalledSub(), 0,1)
+ Goto Exit_Function
+End Function &apos; _CurrentDb
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _DFunction(ByVal psFunction As String _
+ , ByVal psExpr As String _
+ , ByVal psDomain As String _
+ , ByVal pvCriteria As Variant _
+ , ByVal Optional pvOrderClause As Variant _
+ ) As Variant
+ &apos;Arguments: psFunction an optional aggregate function
+ &apos; psExpr: an SQL expression [might contain an aggregate function]
+ &apos; psDomain: a table- or queryname
+ &apos; pvCriteria: an optional WHERE clause
+ &apos; pcOrderClause: an optional order clause incl. &quot;DESC&quot; if relevant
+
+If _ErrorHandler() Then On Local Error GoTo Error_Function
+
+Dim oResult As Object &apos;To retrieve the value to find.
+Dim vResult As Variant &apos;Return value for function.
+Dim sSql As String &apos;SQL statement.
+Dim oStatement As Object &apos;For CreateStatement method
+Dim sExpr As String &apos;For inclusion of aggregate function
+
+ vResult = Null
+
+ If psFunction = &quot;&quot; Then sExpr = &quot;TOP 1 &quot; &amp; psExpr Else sExpr = UCase(psFunction) &amp; &quot;(&quot; &amp; psExpr &amp; &quot;)&quot;
+
+ sSql = &quot;SELECT &quot; &amp; sExpr &amp; &quot; AS XXRESULTFIELDXX FROM &quot; &amp; psDomain
+ If pvCriteria &lt;&gt; &quot;&quot; Then
+ sSql = sSql &amp; &quot; WHERE &quot; &amp; pvCriteria
+ End If
+ If pvOrderClause &lt;&gt; &quot;&quot; Then
+ sSql = sSql &amp; &quot; ORDER BY &quot; &amp; pvOrderClause
+ End If
+ sSql = Utils._ReplaceSquareBrackets(sSql) &apos;Substitute [] by quote string
+
+ &apos;Lookup the value.
+Dim oDatabase As Object
+ Set oStatement = _CurrentDb.Connection.createStatement()
+ With oStatement
+ .ResultSetType = com.sun.star.sdbc.ResultSetType.FORWARD_ONLY
+ .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY
+ .EscapeProcessing = False
+ Set oResult = .executeQuery(sSql)
+ If Not IsNull(oResult) And Not IsEmpty(oResult) Then
+ If Not oResult.next() Then Goto Exit_Function
+ vResult = Utils._getResultSetColumnValue(oResult, 1)
+ End If
+ End With
+
+Exit_Function:
+ &apos;Assign the returned value.
+ _DFunction = vResult
+ Set oResult = Nothing
+ Set oStatement = Nothing
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, ERRDFUNCTION, _A2B_.CalledSub, 0, , sSQL)
+ Goto Exit_Function
+End Function &apos; DFunction V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _NewBar() As Object
+&apos; Close current status bar, if any, and initialize new one
+
+Dim vBar As Variant, vWindow As Variant, oDb As Object, vController As Object
+ On Local Error Resume Next
+ Set _NewBar = Nothing
+
+ Set oDb = Application._CurrentDb()
+ Set vBar = oDb.StatusBar
+ If Not IsNull(vBar) Then
+ If Utils._hasUNOMethod(vBar, &quot;end&quot;) Then vBar.end()
+ Set oDb.StatusBar = Nothing
+ End If
+
+ Set vBar = Nothing
+ Set vWindow = _SelectWindow()
+ If IsNull(vWindow.Frame) Then Exit Function
+ Select Case vWindow.WindowType
+ Case acForm, acReport, acBasicIDE &apos; Not found how to make it work for acDatabaseWindow
+ Case Else
+ Exit Function
+ End Select
+ If Utils._hasUNOMethod(vWindow.Frame, &quot;getCurrentController&quot;) Then
+ Set vController = vWindow.Frame.getCurrentController()
+ ElseIf Utils._hasUNOMethod(vWindow.Frame, &quot;getController&quot;) Then
+ Set vController = vWindow.Frame.getController()
+ End If
+
+ If Utils._hasUNOMethod(vController, &quot;getStatusIndicator&quot;) Then vBar = vController.getStatusIndicator()
+ Set oDb.StatusBar = vBar
+ Set _NewBar = vBar
+ Exit Function
+
+End Function &apos; _NewBar V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub _RootInit()
+&apos; Initialize _A2B_ global variable
+
+Dim vRoot As Root
+ If IsEmpty(_A2B_) Then
+ _A2B_ = vRoot
+ With _A2B_
+ .VersionNumber = Access2Base_Version
+ .ErrorHandler = True
+ .MinimalTraceLevel = 0
+ .TraceLogs() = Array()
+ .TraceLogCount = 0
+ .TraceLogLast = 0
+ .TraceLogMaxEntries = 0
+ .CalledSub = &quot;&quot;
+ .Introspection = Nothing
+ End With
+ End If
+
+End Sub &apos; _RootInit V0.9.1
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Collect.xba b/wizards/source/access2base/Collect.xba
new file mode 100644
index 000000000000..43cd91a2a2f2
--- /dev/null
+++ b/wizards/source/access2base/Collect.xba
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Collect" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM MODULE NAME &lt;&gt; COLLECTION (seems a reserved name ?)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be COLLECTION
+Private _CollType As String
+Private _ParentType As String
+Private _ParentName As String &apos; Name or shortcut
+Private _Count As Long
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJCOLLECTION
+ _CollType = &quot;&quot;
+ _ParentType = &quot;&quot;
+ _ParentName = &quot;&quot;
+ _Count = 0
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get Count() As Long
+ Count = _PropertyGet(&quot;Count&quot;)
+End Property &apos; Count (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Item(ByVal Optional pvItem As Variant) As Variant
+&apos;Return property value.
+&apos;pvItem either numeric index or property name
+
+Const cstThisSub = &quot;Collection.getItem&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvItem) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvItem, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+
+Dim vNames() As Variant, oProperty As Object
+
+ Set Item = Nothing
+ Select Case _CollType
+ Case COLLALLDIALOGS
+ Set Item = Application.AllDialogs(pvItem)
+ Case COLLALLFORMS
+ Set Item = Application.AllForms(pvItem)
+ Case COLLCONTROLS
+ Select Case _ParentType
+ Case OBJCONTROL, OBJSUBFORM
+ Set Item = getObject(_ParentName).Controls(pvItem)
+ Case OBJDIALOG
+ Set Item = Application.AllDialogs(_ParentName).Controls(pvItem)
+ Case OBJFORM
+ Set Item = Application.Forms(_ParentName).Controls(pvItem)
+ Case OBJOPTIONGROUP
+ &apos; NOT SUPPORTED
+ End Select
+ Case COLLFORMS
+ Set Item = Application.Forms(pvItem)
+ Case COLLFIELDS
+ Select Case _ParentType
+ Case OBJQUERYDEF
+ Set Item = Application.CurrentDb().QueryDefs(_ParentName).Fields(pvItem)
+ Case OBJRECORDSET
+ Set Item = Application.CurrentDb().Recordsets(_ParentName).Fields(pvItem)
+ Case OBJTABLEDEF
+ Set Item = Application.CurrentDb().TableDefs(_ParentName).Fields(pvItem)
+ End Select
+ Case COLLPROPERTIES
+ Select Case _ParentType
+ Case OBJCONTROL, OBJSUBFORM
+ Set Item = getObject(_ParentName).Properties(pvItem)
+ Case OBJDATABASE
+ Set Item = Application.CurrentDb().Properties(pvItem)
+ Case OBJDIALOG
+ Set Item = Application.AllDialogs(_ParentName).Properties(pvItem)
+ Case OBJFIELD
+ vNames() = Split(_ParentName, &quot;/&quot;)
+ Select Case vNames(0)
+ Case OBJQUERYDEF
+ Set Item = Application.CurrentDb().QueryDefs(vNames(1)).Fields(vNames(2)).Properties(pvItem)
+ Case OBJRECORDSET
+ Set Item = Application.CurrentDb().Recordsets(vNames(1)).Fields(vNames(2)).Properties(pvItem)
+ Case OBJTABLEDEF
+ Set Item = Application.CurrentDb().TableDefs(vNames(1)).Fields(vNames(2)).Properties(pvItem)
+ End Select
+ Case OBJFORM
+ Set Item = Application.Forms(_ParentName).Properties(pvItem)
+ Case OBJQUERYDEF
+ Set Item = Application.CurrentDb().QueryDefs(_ParentName).Properties(pvItem)
+ Case OBJRECORDSET
+ Set Item = Application.CurrentDb().Recordsets(_ParentName).Properties(pvItem)
+ Case OBJTABLEDEF
+ Set Item = Application.CurrentDb().TableDefs(_ParentName).Properties(pvItem)
+ Case OBJCOLLECTION, OBJEVENT, OBJOPTIONGROUP
+ &apos; NOT SUPPORTED
+ End Select
+ Case COLLQUERYDEFS
+ Set Item = Application.CurrentDb().QueryDefs(pvItem)
+ Case COLLRECORDSETS
+ Set Item = Application.CurrentDb().Recordsets(pvItem)
+ Case COLLTABLEDEFS
+ Set Item = Application.CurrentDb().TableDefs(pvItem)
+ Case Else
+ End Select
+
+Exit_Function:
+ Exit Property
+Error_Function:
+ TraceError(TRACEABORT, Err, Utils._CalledSub(), Erl)
+ Set Item = Nothing
+ GoTo Exit_Function
+End Property &apos; V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _ParentName, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _ParentName, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Collection.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Collection.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+ _PropertiesList = Array(&quot;Count&quot;, &quot;ObjectType&quot;)
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Collection.get&quot; &amp; psProperty)
+ _PropertyGet = Nothing
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Count&quot;)
+ _PropertyGet = _Count
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Collection.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Collection._PropertyGet&quot;, Erl)
+ _PropertyGet = Nothing
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Compatible.xba b/wizards/source/access2base/Compatible.xba
new file mode 100644
index 000000000000..1e263000674f
--- /dev/null
+++ b/wizards/source/access2base/Compatible.xba
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Compatible" script:language="StarBasic">Option Compatible
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub DebugPrint(ParamArray pvArgs() As Variant)
+
+&apos;Print arguments unconditionnally in console
+&apos;Arguments are separated by a TAB (simulated by spaces)
+&apos;Some pvArgs might be missing: a TAB is still generated
+
+Dim vVarTypes() As Variant, i As Integer
+Const cstTab = 5
+ On Local Error Goto Exit_Sub &apos; Never interrupt processing
+ Utils._SetCalledSub(&quot;DebugPrint&quot;)
+ vVarTypes = Utils._AddNumeric(Array(vbEmpty, vbNull, vbDate, vbString, vbBoolean, vbObject, vbVariant))
+
+ If UBound(pvArgs) &gt;= 0 Then
+ For i = 0 To UBound(pvArgs)
+&apos; If IsError(pvArgs(i)) Then &apos; IsError gives &quot;Object variable not set&quot; in LO 4,0 ?!?
+&apos; pvArgs(i) = &quot;[ERROR]&quot;
+&apos; Else
+ If Not Utils._CheckArgument(pvArgs(i), i + 1, vVarTypes(), , False) Then pvArgs(i) = &quot;[TYPE?]&quot;
+&apos; End If
+ Next i
+ End If
+
+Dim sOutput As String, sArg As String
+ sOutput = &quot;&quot;
+ For i = 0 To UBound(pvArgs)
+ sArg = Utils._CStr(pvArgs(i))
+ &apos; Add argument to output
+ If i = 0 Then
+ sOutput = sArg
+ Else
+ sOutput = sOutput &amp; Space(cstTab - (Len(sOutput) Mod cstTab)) &amp; sArg
+ End If
+ Next i
+
+ TraceLog(TRACEANY, sOutput, False)
+
+Exit_Sub:
+ Utils._ResetCalledSub(&quot;DebugPrint&quot;)
+ Exit Sub
+End Sub &apos; DebugPrint V0.9.5
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Control.xba b/wizards/source/access2base/Control.xba
new file mode 100644
index 000000000000..b922416f9fde
--- /dev/null
+++ b/wizards/source/access2base/Control.xba
@@ -0,0 +1,2185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Control" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be CONTROL
+Private _ImplementationName As String
+Private _ClassId As Integer
+Private _ParentType As String &apos; One of CTLPARENTISxxxx constants
+Private _Shortcut As String
+Private _Name As String
+Private _FormComponent As Object &apos; com.sun.star.text.TextDocument
+Private _ControlType As Integer
+Private _SubType As String
+Private ControlModel As Object &apos; com.sun.star.comp.forms.XXXModel
+Private ControlView As Object &apos; com.sun.star.comp.forms.XXXControl
+Private BoundField As Object &apos; com.sun.star.sdb.ODataColumn
+Private LabelControl As Object &apos; com.sun.star.form.component.FixedText or com.sun.star.form.component.GroupBox
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJCONTROL
+ _ClassId = -1
+ _ParentType = &quot;&quot;
+ _Shortcut = &quot;&quot;
+ _Name = &quot;&quot;
+ _SubType = &quot;&quot;
+ Set ControlModel = Nothing
+ Set ControlView = Nothing
+ Set BoundField = Nothing
+ Set LabelControl = Nothing
+
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get BackColor() As Variant
+ BackColor = _PropertyGet(&quot;BackColor&quot;)
+End Property &apos; BackColor (get)
+
+Property Let BackColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BackColor&quot;, pvValue)
+End Property &apos; BackColor (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get BorderColor() As Variant
+ BorderColor = _PropertyGet(&quot;BorderColor&quot;)
+End Property &apos; BorderColor (get)
+
+Property Let BorderColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BorderColor&quot;, pvValue)
+End Property &apos; BorderColor (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get BorderStyle() As Variant
+ BorderStyle = _PropertyGet(&quot;BorderStyle&quot;)
+End Property &apos; BorderStyle (get)
+
+Property Let BorderStyle(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BorderStyle&quot;, pvValue)
+End Property &apos; BorderStyle (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Cancel() As Variant
+ Cancel = _PropertyGet(&quot;Cancel&quot;)
+End Property &apos; Cancel (get)
+
+Property Let Cancel(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Cancel&quot;, pvValue)
+End Property &apos; Cancel (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Caption() As Variant
+ Caption = _PropertyGet(&quot;Caption&quot;)
+End Property &apos; Caption (get)
+
+Property Let Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ControlSource() As Variant
+ ControlSource = _PropertyGet(&quot;ControlSource&quot;)
+End Property &apos; ControlSource (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ControlTipText() As Variant
+ ControlTipText = _PropertyGet(&quot;ControlTipText&quot;)
+End Property &apos; ControlTipText (get)
+
+Property Let ControlTipText(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ControlTipText&quot;, pvValue)
+End Property &apos; ControlTipText (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ControlType() As Variant
+ ControlType = _PropertyGet(&quot;ControlType&quot;)
+End Property &apos; ControlType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Default() As Variant
+ Default = _PropertyGet(&quot;Default&quot;)
+End Property &apos; Default (get)
+
+Property Let Default(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Default&quot;, pvValue)
+End Property &apos; Default (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get DefaultValue() As Variant
+ DefaultValue = _PropertyGet(&quot;DefaultValue&quot;)
+End Property &apos; DefaultValue (get)
+
+Property Let DefaultValue(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;DefaultValue&quot;, pvValue)
+End Property &apos; DefaultValue (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Enabled() As Variant
+ Enabled = _PropertyGet(&quot;Enabled&quot;)
+End Property &apos; Enabled (get)
+
+Property Let Enabled(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Enabled&quot;, pvValue)
+End Property &apos; Enabled (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontBold() As Variant
+ FontBold = _PropertyGet(&quot;FontBold&quot;)
+End Property &apos; FontBold (get)
+
+Property Let FontBold(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontBold&quot;, pvValue)
+End Property &apos; FontBold (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontItalic() As Variant
+ FontItalic = _PropertyGet(&quot;FontItalic&quot;)
+End Property &apos; FontItalic (get)
+
+Property Let FontItalic(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontItalic&quot;, pvValue)
+End Property &apos; FontItalic (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontName() As Variant
+ FontName = _PropertyGet(&quot;FontName&quot;)
+End Property &apos; FontName (get)
+
+Property Let FontName(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontName&quot;, pvValue)
+End Property &apos; FontName (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontSize() As Variant
+ FontSize = _PropertyGet(&quot;FontSize&quot;)
+End Property &apos; FontSize (get)
+
+Property Let FontSize(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontSize&quot;, pvValue)
+End Property &apos; FontSize (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontUnderline() As Variant
+ FontUnderline = _PropertyGet(&quot;FontUnderline&quot;)
+End Property &apos; FontUnderline (get)
+
+Property Let FontUnderline(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontUnderline&quot;, pvValue)
+End Property &apos; FontUnderline (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FontWeight() As Variant
+ FontWeight = _PropertyGet(&quot;FontWeight&quot;)
+End Property &apos; FontWeight (get)
+
+Property Let FontWeight(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontWeight&quot;, pvValue)
+End Property &apos; FontWeight (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ForeColor() As Variant
+ ForeColor = _PropertyGet(&quot;ForeColor&quot;)
+End Property &apos; ForeColor (get)
+
+Property Let ForeColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ForeColor&quot;, pvValue)
+End Property &apos; ForeColor (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Form() As Variant
+ Form = _PropertyGet(&quot;Form&quot;)
+End Property &apos; Form (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Format() As Variant
+ Format = _PropertyGet(&quot;Format&quot;)
+End Property &apos; Format (get)
+
+Property Let Format(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Format&quot;, pvValue)
+End Property &apos; Format (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ItemData(ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvIndex) Then ItemData = _PropertyGet(&quot;ItemData&quot;) Else ItemData = _PropertyGet(&quot;ItemData&quot;, pvIndex)
+End Property &apos; ItemData (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ListCount() As Variant
+ ListCount = _PropertyGet(&quot;ListCount&quot;)
+End Property &apos; ListCount (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ListIndex() As Variant
+ ListIndex = _PropertyGet(&quot;ListIndex&quot;)
+End Property &apos; ListIndex (get)
+
+Property Let ListIndex(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ListIndex&quot;, pvValue)
+End Property &apos; ListIndex (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Locked() As Variant
+ Locked = _PropertyGet(&quot;Locked&quot;)
+End Property &apos; Locked (get)
+
+Property Let Locked(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Locked&quot;, pvValue)
+End Property &apos; Locked (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get MultiSelect() As Variant
+ MultiSelect = _PropertyGet(&quot;MultiSelect&quot;)
+End Property &apos; MultiSelect (get)
+
+Property Let MultiSelect(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;MultiSelect&quot;, pvValue)
+End Property &apos; MultiSelect (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OptionValue() As Variant
+ OptionValue = _PropertyGet(&quot;OptionValue&quot;)
+End Property &apos; OptionValue (get)
+
+Property Let OptionValue(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;OptionValue&quot;, pvValue)
+End Property &apos; OptionValue (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Page() As Variant
+ Page = _PropertyGet(&quot;Page&quot;)
+End Property &apos; Page (get)
+
+Property Let Page(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Page&quot;, pvValue)
+End Property &apos; Page (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Parent() As Object
+ Parent = _PropertyGet(&quot;Parent&quot;)
+End Function &apos; Parent (get) V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+ Utils._SetCalledSub(&quot;Control.Properties&quot;)
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Shortcut, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Shortcut, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Utils._ResetCalledSub(&quot;Control.Properties&quot;)
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Required() As Variant
+ Required = _PropertyGet(&quot;Required&quot;)
+End Property &apos; Required (get)
+
+Property Let Required(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Required&quot;, pvValue)
+End Property &apos; Required (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RowSource() As Variant
+ RowSource = _PropertyGet(&quot;RowSource&quot;)
+End Property &apos; RowSource (get)
+
+Property Let RowSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RowSource&quot;, pvValue)
+End Property &apos; RowSource (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RowSourceType() As Variant
+ RowSourceType = _PropertyGet(&quot;RowSourceType&quot;)
+End Property &apos; RowSourceType (get)
+
+Property Let RowSourceType(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RowSourceType&quot;, pvValue)
+End Property &apos; RowSourceType (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Selected(ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvIndex) Then Selected = _PropertyGet(&quot;Selected&quot;) Else Selected = _PropertyGet(&quot;Selected&quot;, pvIndex)
+End Property &apos; Selected (get)
+
+Property Let Selected(ByVal pvValue As Variant) &apos; , ByVal Optional pvIndex As Variant)
+&apos; If IsMissing(pvIndex) Then Call _PropertySet(&quot;Selected&quot;, pvValue) Else Call _PropertySet(&quot;Selected&quot;, pvValue, pvIndex)
+ Call _PropertySet(&quot;Selected&quot;, pvValue)
+End Property &apos; Selected (set)
+
+Public Function SelectedI(ByVal pvValue As variant, ByVal pvIndex As Variant)
+ Call _PropertySet(&quot;Selected&quot;, pvValue, pvIndex)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SpecialEffect() As Variant
+ SpecialEffect = _PropertyGet(&quot;SpecialEffect&quot;)
+End Property &apos; SpecialEffect (get)
+
+Property Let SpecialEffect(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;SpecialEffect&quot;, pvValue)
+End Property &apos; SpecialEffect (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SubType() As Variant
+ SubType = _PropertyGet(&quot;SubType&quot;)
+End Property &apos; SubType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get TabIndex() As Variant
+ TabIndex = _PropertyGet(&quot;TabIndex&quot;)
+End Property &apos; TabIndex (get)
+
+Property Let TabIndex(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TabIndex&quot;, pvValue)
+End Property &apos; TabIndex (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get TabStop() As Variant
+ TabStop = _PropertyGet(&quot;TabStop&quot;)
+End Property &apos; TabStop (get)
+
+Property Let TabStop(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TabStop&quot;, pvValue)
+End Property &apos; TabStop (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Tag() As Variant
+ Tag = _PropertyGet(&quot;Tag&quot;)
+End Property &apos; Tag (get)
+
+Property Let Tag(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Tag&quot;, pvValue)
+End Property &apos; Tag (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Text() As Variant
+ Text = _PropertyGet(&quot;Text&quot;)
+End Property &apos; Text (get)
+
+Public Function pText() As variant
+ pText = _PropertyGet(&quot;Text&quot;)
+End Function &apos; pText (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get TextAlign() As Variant
+ TextAlign = _PropertyGet(&quot;TextAlign&quot;)
+End Property &apos; TextAlign (get)
+
+Property Let TextAlign(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TextAlign&quot;, pvValue)
+End Property &apos; TextAlign (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get TripleState() As Variant
+ TripleState = _PropertyGet(&quot;TripleState&quot;)
+End Property &apos; TripleState (get)
+
+Property Let TripleState(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TripleState&quot;, pvValue)
+End Property &apos; TripleState (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Value() As Variant
+ Value = _PropertyGet(&quot;Value&quot;)
+End Property &apos; Value (get)
+
+Property Let Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Visible() As Variant
+ Visible = _PropertyGet(&quot;Visible&quot;)
+End Property &apos; Visible (get)
+
+Property Let Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function AddItem(ByVal Optional pvItem As Variant, ByVal Optional pvIndex) As Boolean
+&apos; Add an item in a Listbox
+
+ Utils._SetCalledSub(&quot;Control.AddItem&quot;)
+ AddItem = False
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If IsMissing(pvItem) Then Call _TraceArguments()
+ If IsMissing(pvIndex) Then pvIndex = -1
+
+Dim iArgNr As Integer
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;AddItem&quot;) : iArgNr = 1
+ Case UCase(&quot;Control.AddItem&quot;) : iArgNr = 0
+ End Select
+
+ If Not Utils._CheckArgument(pvItem, iArgNr + 1, vbString) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvIndex, iArgNr + 2, Utils._AddNumeric()) Then Goto Exit_Function
+ If _SubType &lt;&gt; CTLLISTBOX Then Goto Error_Control
+ If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
+ If ControlModel.ListSourceType &lt;&gt; com.sun.star.form.ListSourceType.VALUELIST Then Goto Error_Control
+ End If
+
+Dim vRowSource() As Variant, iCount As Integer, i As Integer
+ If IsArray(ControlModel.StringItemList) Then vRowSource = ControlModel.StringItemList Else vRowSource = Array(ControlModel.StringItemList)
+ iCount = UBound(vRowSource)
+ If pvIndex &lt; -1 Or pvIndex &gt; iCount + 1 Then Goto Error_Index
+ ReDim Preserve vRowSource(0 To iCount + 1)
+ If pvIndex = -1 Then pvIndex = iCount + 1
+ For i =iCount + 1 To pvIndex + 1 Step -1
+ vRowSource(i) = vRowSource(i - 1)
+ Next i
+ vRowSource(pvIndex) = pvItem
+
+ If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
+ ControlModel.ListSource = vRowSource()
+ End If
+ ControlModel.StringItemList = vRowSource()
+ AddItem = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.AddItem&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control.AddItem&quot;, Erl)
+ AddItem = False
+ GoTo Exit_Function
+Error_Control:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , &quot;Control.AddItem&quot;)
+ AddItem = False
+ Goto Exit_Function
+Error_Index:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), False, ,Array(iArgNr + 2,pvIndex))
+ AddItem = False
+ Goto Exit_Function
+End Function &apos; AddItem V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
+&apos; Return a Control object with name or index = pvIndex
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Grid.Controls&quot;)
+
+Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
+Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
+Dim j As Integer, oView As Object
+
+ If _SubType &lt;&gt; CTLGRIDCONTROL Then Goto Trace_Error_Context
+ Set ocControl = Nothing
+ iControlCount = ControlModel.getCount()
+
+ If IsMissing(pvIndex) Then &apos; No argument, return Collection pseudo-object
+ Set oCounter = New Collect
+ oCounter._CollType = COLLCONTROLS
+ oCounter._ParentType = OBJCONTROL
+ oCounter._ParentName = _Shortcut
+ oCounter._Count = iControlCount
+ Set Controls = oCounter
+ Goto Exit_Function
+ End If
+
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+
+ &apos; Start building the ocControl object
+ &apos; Determine exact name
+ Set ocControl = New Control
+ ocControl._ParentType = CTLPARENTISGRID
+ sParentShortcut = _Shortcut
+ sControls() = ControlModel.getElementNames()
+
+ Select Case VarType(pvIndex)
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
+ ocControl._Name = sControls(pvIndex)
+ Case vbString &apos; Check control name validity (non case sensitive)
+ bFound = False
+ sIndex = UCase(Utils._Trim(pvIndex))
+ For i = 0 To iControlCount - 1
+ If UCase(sControls(i)) = sIndex Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
+ End Select
+
+ ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
+ Set ocControl.ControlModel = ControlModel.getByName(ocControl._Name)
+ ocControl._ImplementationName = ocControl.ControlModel.ColumnServiceName &apos; getImplementationName aborts for subcontrols !?
+ ocControl._FormComponent = ParentComponent
+ If Utils._hasUNOProperty(ocControl.ControlModel, &quot;ClassId&quot;) Then ocControl._ClassId = ocControl.ControlModel.ClassId
+ &apos; Complex bypass to find View of grid subcontrols !
+ For i = 0 to ControlView.getCount() - 1
+ Set oView = ControlView.GetByIndex(i)
+ If oView.getModel.Name = ocControl._Name Then
+ Set ocControl.ControlView = oView
+ Exit For
+ End If
+ Next i
+
+ ocControl._Initialize()
+ Set Controls = ocControl
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Grid.Controls&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, vObject._Name))
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Context:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , &quot;Grid.Controls&quot;)
+ Set Controls = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Grid.Controls&quot;, Erl)
+ Set Controls = Nothing
+ GoTo Exit_Function
+End Function &apos; Controls
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Control.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ If IsMissing(pvIndex) Then
+ getProperty = _PropertyGet(pvProperty)
+ Else
+ getProperty = _PropertyGet(pvProperty, pvIndex)
+ End If
+ Utils._ResetCalledSub(&quot;Control.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function RemoveItem(ByVal Optional pvIndex) As Boolean
+&apos; Remove an item from a Listbox
+&apos; Index may be a string value or an index-position
+
+ Utils._SetCalledSub(&quot;Control.RemoveItem&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If IsMissing(pvIndex) Then Call _TraceArguments()
+Dim iArgNr As Integer
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;RemoveItem&quot;) : iArgNr = 1
+ Case UCase(&quot;Control.RemoveItem&quot;) : iArgNr = 0
+ End Select
+ If Not Utils._CheckArgument(pvIndex, iArgNr + 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ If _SubType &lt;&gt; CTLLISTBOX Then Goto Error_Control
+ If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
+ If ControlModel.ListSourceType &lt;&gt; com.sun.star.form.ListSourceType.VALUELIST Then Goto Error_Control
+ End If
+
+Dim vRowSource() As Variant, iCount As Integer, i As Integer, j As integer, bFound As Boolean
+ If IsArray(ControlModel.StringItemList) Then vRowSource = ControlModel.StringItemList Else vRowSource = Array(ControlModel.StringItemList)
+ iCount = UBound(vRowSource)
+
+ Select Case VarType(pvIndex)
+ Case vbString
+ bFound = False
+ For i = 0 To iCount
+ If vRowSource(i) = pvIndex Then
+ For j = i To iCount - 1
+ vRowSource(j) = vRowSource(j + 1)
+ Next j
+ ReDim Preserve vRowSource(0 To iCount - 1)
+ bFound = True
+ Exit For &apos; Remove only 1st occurrence of string
+ End If
+ Next i
+ Case Else
+ If pvIndex &lt; 0 Or pvIndex &gt; iCount Then Goto Error_Index
+ bFound = True
+ For i = pvIndex To iCount - 1
+ vRowSource(i) = vRowSource(i + 1)
+ Next i
+ ReDim Preserve vRowSource(0 To iCount - 1)
+ End Select
+
+ If bFound Then
+ If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
+ ControlModel.ListSource = vRowSource()
+ End If
+ ControlModel.StringItemList = vRowSource()
+ RemoveItem = True
+ Else
+ RemoveItem = False
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.RemoveItem&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control.RemoveItem&quot;, Erl)
+ RemoveItem = False
+ GoTo Exit_Function
+Error_Control:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0)
+ RemoveItem = False
+ Goto Exit_Function
+Error_Index:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), False, ,2)
+ RemoveItem = False
+ Goto Exit_Function
+End Function &apos; RemoveItem V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Requery() As Boolean
+&apos; Refresh data displayed in a form, subform, combobox or listbox
+ Utils._SetCalledSub(&quot;Control.Requery&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Requery = False
+
+ Select Case _SubType
+ Case CTLCOMBOBOX, CTLLISTBOX
+ If Utils._InList(ControlModel.ListSourceType, Array( _
+ com.sun.star.form.ListSourceType.QUERY _
+ , com.sun.star.form.ListSourceType.TABLE _
+ , com.sun.star.form.ListSourceType.TABLEFIELDS _
+ , com.sun.star.form.ListSourceType.SQL _
+ , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
+ )) Then
+ ControlModel.refresh()
+ End If
+ Case Else
+ Goto Error_Control
+ End Select
+ Requery = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.Requery&quot;)
+ Exit Function
+Error_Control:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0)
+ Requery = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control.Requery&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Requery
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFocus() As Boolean
+&apos; Execute setFocus method
+ Utils._SetCalledSub(&quot;Control.setFocus&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ setFocus = False
+
+Dim i As Integer, j As Integer, iColPosition As Integer
+Dim ocControl As Object, ocGrid As Variant, oGridModel As Object
+ If _ParentType = CTLPARENTISGRID Then &apos;setFocus method does not work on controlviews in grid ?!?
+ &apos; Find column position of control
+ iColPosition = -1
+ ocGrid = getObject(_getUpperShortcut(_Shortcut, _Name)) &apos; return containing grid
+ Set oGridModel = ocGrid.ControlModel
+ j = -1
+ For i = 0 To oGridModel.Count - 1
+ Set ocControl = oGridModel.GetByIndex(i)
+ If Not ocControl.Hidden Then j = j + 1 &apos; Skip if hidden
+ If oGridModel.GetByIndex(i).Name = _Name Then
+ iColPosition = j
+ Exit For
+ End If
+ Next i
+ If iColPosition &gt;= 0 Then
+ ocGrid.ControlView.setFocus() &apos;Set first focus on grid itself
+ ocGrid.ControlView.setCurrentColumnPosition(iColPosition) &apos;Deprecated but no alternative found
+ Else
+ Goto Error_Grid
+ End If
+ Else
+ ControlView.setFocus()
+ End If
+ setFocus = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.setFocus&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control.setFocus&quot;, Erl)
+ Goto Exit_Function
+Error_Grid:
+ TraceError(TRACEFATAL, ERRFOCUSINGRID, Utils._CalledSub(), 0, 1, Array(_Name, ocGrid._Name))
+ Goto Exit_Function
+End Function &apos; setFocus V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;Control.setProperty&quot;)
+ If IsMissing(pvIndex) Then
+ setProperty = _PropertySet(psProperty, pvValue)
+ Else
+ setProperty = _PropertySet(psProperty, pvValue, pvIndex)
+ End If
+ Utils._ResetCalledSub(&quot;Control.setProperty&quot;)
+End Function &apos; setProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _Formats(ByVal psControlType As String) As Variant
+&apos; Return allowed format entries for Date and Time control types
+
+Dim vFormats() As Variant
+ Select Case psControlType
+ Case CTLDATEFIELD
+ vFormats = Array( _
+ &quot;Standard (short)&quot; _
+ , &quot;Standard (short YY)&quot; _
+ , &quot;Standard (short YYYY)&quot; _
+ , &quot;Standard (long)&quot; _
+ , &quot;DD/MM/YY&quot; _
+ , &quot;MM/DD/YY&quot; _
+ , &quot;YY/MM/DD&quot; _
+ , &quot;DD/MM/YYYY&quot; _
+ , &quot;MM/DD/YYYY&quot; _
+ , &quot;YYYY/MM/DD&quot; _
+ , &quot;YY-MM-DD&quot; _
+ , &quot;YYYY-MM-DD&quot; _
+ )
+ Case CTLTIMEFIELD
+ vFormats = Array( _
+ &quot;24h short&quot; _
+ , &quot;24h long&quot; _
+ , &quot;12h short&quot; _
+ , &quot;12h long&quot; _
+ )
+ Case Else
+ vFormats = Array()
+ End Select
+
+ _Formats = vFormats
+
+End Function &apos; _Formats V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub _Initialize()
+&apos; Initialize new Control
+&apos; ControlModel, ParentType, Name, Shortcut, ControlView, ImplementationName, ClassId (if parent &lt;&gt; dialog)
+&apos; are presumed preexisting
+
+ &apos; Identify SubType and ControlView
+Dim sControlTypes() As Variant, i As Integer, vSplit() As Variant, sTrailer As String
+ sControlTypes = array( CTLCONTROL _
+ , CTLCOMMANDBUTTON _
+ , CTLRADIOBUTTON _
+ , CTLIMAGEBUTTON _
+ , CTLCHECKBOX _
+ , CTLLISTBOX _
+ , CTLCOMBOBOX _
+ , CTLGROUPBOX _
+ , CTLTEXTFIELD _
+ , CTLFIXEDTEXT _
+ , CTLGRIDCONTROL _
+ , CTLFILECONTROL _
+ , CTLHIDDENCONTROL _
+ , CTLIMAGECONTROL _
+ , CTLDATEFIELD _
+ , CTLTIMEFIELD _
+ , CTLNUMERICFIELD _
+ , CTLCURRENCYFIELD _
+ , CTLPATTERNFIELD _
+ , CTLSCROLLBAR _
+ , CTLSPINBUTTON _
+ , CTLNAVIGATIONBAR _
+ , CTLPROGRESSBAR _
+ , CTLFIXEDLINE _
+ )
+
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG
+ vSplit = Split(ControlModel.getServiceName(), &quot;.&quot;)
+ sTrailer = UCase(vSplit(UBound(vSplit)))
+ &apos; Manage homonyms
+ Select Case sTrailer
+ Case &quot;BUTTON&quot; : sTrailer = CTLCOMMANDBUTTON
+ Case &quot;EDIT&quot; : sTrailer = CTLTEXTFIELD
+ Case Else
+ End Select
+ If sTrailer &lt;&gt; CTLFORMATTEDFIELD Then
+ For i = 0 To UBound(sControlTypes)
+ If sControlTypes(i) = sTrailer Then
+ _ClassId = i + 1
+ _SubType = sTrailer
+ _ControlType = _ClassId
+ Exit For
+ End If
+ Next i
+ Else
+ _ClassId = acFormattedField
+ _SubType = CTLFORMATTEDFIELD
+ _ControlType = _ClassId
+ End If
+ Case Else
+ &apos;Is ClassId one of the properties ?
+ If _ClassId &gt; 0 Then &apos; All control types have a ClassId except subforms
+ _SubType = sControlTypes(_ClassId - 1)
+ _ControlType = _ClassId
+ If _SubType = CTLTEXTFIELD Then &apos; Formatted fields belong to the TextField family
+ If _ImplementationName = &quot;com.sun.star.comp.forms.OFormattedFieldWrapper&quot; _
+ Or _ImplementationName = &quot;com.sun.star.form.component.FormattedField&quot; Then &apos; When in datagrid
+ _SubType = CTLFORMATTEDFIELD
+ _ControlType = acFormattedField
+ End If
+ End If
+ Else &apos; Initialize subform Control
+ If ControlModel.ImplementationName = &quot;com.sun.star.comp.forms.ODatabaseForm&quot; Then
+ _SubType = CTLSUBFORM
+ _ControlType = acSubform
+ End If
+ End If
+ End Select
+
+End Sub &apos; _Initialize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _ListboxBound() As Boolean
+&apos; Return True if listbox has a bound column
+
+Dim bListboxBound As Boolean, j As Integer
+Dim vValue() As variant, vString As Variant
+
+ bListboxBound = False
+
+ If Not IsNull(ControlModel.ValueItemList) _
+ And ControlModel.DataField &lt;&gt; &quot;&quot; _
+ And Not IsNull(ControlModel.BoundField) _
+ And Utils._InList(ControlModel.ListSourceType, Array( _
+ com.sun.star.form.ListSourceType.TABLE _
+ , com.sun.star.form.ListSourceType.QUERY _
+ , com.sun.star.form.ListSourceType.SQL _
+ , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
+ )) Then &apos; MultiSelect behaviour changed in OpenOffice &gt;= 3.3
+ If IsArray(ControlModel.ValueItemList) Then
+ vValue = ControlModel.ValueItemList
+ vString = ControlModel.StringItemList
+ For j = 0 To UBound(vValue)
+ If VarType(vValue(j)) &lt;&gt; VarType(vString(j)) Then
+ bListboxBound = True
+ ElseIf vValue(j) &lt;&gt; vString(j) Then
+ bListboxBound = True
+ End If
+ If bListboxBound Then Exit For
+ Next j
+ End If
+ End If
+
+ _ListboxBound = bListboxBound
+
+End Function &apos; _ListboxBound V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+&apos; Based on ControlProperties.ods analysis
+
+Dim vFullPropertiesList() As Variant
+ vFullPropertiesList = Array( _
+ &quot;BackColor&quot; _
+ , &quot;BorderColor&quot; _
+ , &quot;BorderStyle&quot; _
+ , &quot;Cancel&quot; _
+ , &quot;Caption&quot; _
+ , &quot;ControlSource&quot; _
+ , &quot;ControlTipText&quot; _
+ , &quot;ControlType&quot; _
+ , &quot;Default&quot; _
+ , &quot;DefaultValue&quot; _
+ , &quot;Enabled&quot; _
+ , &quot;FontBold&quot; _
+ , &quot;FontItalic&quot; _
+ , &quot;FontName&quot; _
+ , &quot;FontSize&quot; _
+ , &quot;FontUnderline&quot; _
+ , &quot;FontWeight&quot; _
+ , &quot;ForeColor&quot; _
+ , &quot;Form&quot; _
+ , &quot;Format&quot; _
+ , &quot;ItemData&quot; _
+ , &quot;LinkChildFields&quot; _
+ , &quot;LinkMasterFields&quot; _
+ , &quot;ListCount&quot; _
+ , &quot;ListIndex&quot; _
+ , &quot;Locked&quot; _
+ , &quot;MultiSelect&quot; _
+ , &quot;Name&quot; _
+ , &quot;ObjectType&quot; _
+ , &quot;OptionValue&quot; _
+ , &quot;Page&quot; _
+ , &quot;Parent&quot; _
+ , &quot;Required&quot; _
+ , &quot;RowSource&quot; _
+ , &quot;RowSourceType&quot; _
+ , &quot;Selected&quot; _
+ , &quot;SpecialEffect&quot; _
+ , &quot;SubType&quot; _
+ , &quot;TabIndex&quot; _
+ , &quot;TabStop&quot; _
+ , &quot;Tag&quot; _
+ , &quot;Text&quot; _
+ , &quot;TextAlign&quot; _
+ , &quot;TripleState&quot; _
+ , &quot;Value&quot; _
+ , &quot;Visible&quot; _
+ )
+Dim vPropertiesMatrix(25) As Variant
+ Select Case _ParentType
+ Case CTLPARENTISFORM, CTLPARENTISSUBFORM
+ vPropertiesMatrix(acCheckBox) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,31,32,36,37,38,39,40,42,43,44,45)
+ vPropertiesMatrix(acComboBox) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,20,23,24,25,27,28,31,32,33,34,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acCommandButton) = Array(0,3,4,6,7,8,9,10,11,12,13,14,15,16,17,27,28,31,37,38,39,40,42,45)
+ vPropertiesMatrix(acCurrencyField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,31,32,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acDateField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,31,32,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acFileControl) = Array(0,1,2,6,7,9,10,11,12,13,14,15,16,17,25,27,28,31,37,38,39,40,41,44,45)
+ vPropertiesMatrix(acFixedLine) = Array()
+ vPropertiesMatrix(acFixedText) = Array(0,1,2,4,6,7,10,11,12,13,14,15,16,17,27,28,31,37,40,42,45)
+ vPropertiesMatrix(acFormattedField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,31,32,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acGridControl) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,27,28,31,37,38,39,40,45)
+ vPropertiesMatrix(acGroupBox) = Array(4,6,7,10,11,12,13,14,15,16,17,27,28,31,37,40,45)
+ vPropertiesMatrix(acHiddenControl) = Array(7,27,28,31,37,40,44,45)
+ vPropertiesMatrix(acImageButton) = Array(0,1,2,6,7,10,27,28,31,37,38,39,40,45)
+ vPropertiesMatrix(acImageControl) = Array(0,1,2,5,6,7,10,25,27,28,31,32,37,38,39,40,45)
+ vPropertiesMatrix(acListBox) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,20,23,24,25,26,27,28,31,32,33,34,35,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acNavigationBar) = Array(0,2,6,7,10,11,12,13,14,15,16,17,27,28,31,37,38,39,40,45)
+ vPropertiesMatrix(acNumericField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,31,32,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acPatternField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,31,32,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acProgressBar) = Array()
+ vPropertiesMatrix(acRadioButton) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,29,31,32,36,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acScrollBar) = Array(0,1,2,6,7,10,27,28,31,37,38,39,40,44,45)
+ vPropertiesMatrix(acSpinButton) = Array(0,1,2,6,7,9,10,27,28,31,37,38,39,40,44,45)
+ vPropertiesMatrix(0) = Array(7,18,21,22,27,28,31,37)
+ vPropertiesMatrix(acTextField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,31,32,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acTimeField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,31,32,37,38,39,40,41,42,44,45)
+ Case CTLPARENTISGROUP
+ &apos; To be duplicated from above !!!
+ vPropertiesMatrix(acRadioButton) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,29,31,32,36,37,38,39,40,42,44,45)
+ Case CTLPARENTISGRID
+ vPropertiesMatrix(acCheckBox) = Array(4,5,6,7,9,10,27,28,31,32,36,37,40,42,43,44)
+ vPropertiesMatrix(acComboBox) = Array(4,5,6,7,9,10,20,23,24,25,27,28,31,32,33,34,37,40,41,42,44)
+ vPropertiesMatrix(acCurrencyField) = Array(4,5,6,7,9,10,25,27,28,31,32,37,40,42,44)
+ vPropertiesMatrix(acDateField) = Array(4,5,6,7,9,10,19,25,27,28,31,32,37,40,41,42,44)
+ vPropertiesMatrix(acFormattedField) = Array(4,5,6,7,9,10,19,25,27,28,31,32,37,40,41,42,44)
+ vPropertiesMatrix(acListBox) = Array(4,5,6,7,9,10,20,23,24,25,26,27,28,31,32,33,34,35,37,40,42,44)
+ vPropertiesMatrix(acNumericField) = Array(4,5,6,7,9,10,25,27,28,31,32,37,40,42,44)
+ vPropertiesMatrix(acPatternField) = Array(4,5,6,7,9,10,25,27,28,31,32,37,40,41,42,44)
+ vPropertiesMatrix(acTextField) = Array(4,5,6,7,9,10,25,27,28,31,32,37,40,41,42,44)
+ vPropertiesMatrix(acTimeField) = Array(4,5,6,7,9,10,19,25,27,28,31,32,37,40,41,42,44)
+ Case CTLPARENTISDIALOG
+ vPropertiesMatrix(acCheckBox) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,30,31,36,37,38,39,40,42,43,44,45)
+ vPropertiesMatrix(acComboBox) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,20,23,24,25,27,28,30,31,33,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acCommandButton) = Array(0,3,4,6,7,8,10,11,12,13,14,15,16,17,27,28,30,31,37,38,39,40,42,45)
+ vPropertiesMatrix(acCurrencyField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,30,31,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acDateField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acFileControl) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acFixedLine) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,30,31,37,38,40,45)
+ vPropertiesMatrix(acFixedText) = Array(0,1,2,4,6,7,10,11,12,13,14,15,16,17,27,28,30,31,37,38,39,40,42,45)
+ vPropertiesMatrix(acFormattedField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acGroupBox) = Array(4,6,7,10,11,12,13,14,15,16,17,27,28,30,31,37,38,40,45)
+ vPropertiesMatrix(acImageControl) = Array(0,1,2,6,7,10,27,28,30,31,37,38,39,40,45)
+ vPropertiesMatrix(acListBox) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,20,23,24,25,26,27,28,30,31,33,35,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acNumericField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,30,31,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acPatternField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acProgressBar) = Array(0,1,2,6,7,10,27,28,30,31,37,38,40,44,45)
+ vPropertiesMatrix(acRadioButton) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,29,30,31,36,37,38,39,40,42,44,45)
+ vPropertiesMatrix(acScrollBar) = Array(0,1,2,6,7,10,27,28,30,31,37,38,39,40,44,45)
+ vPropertiesMatrix(acTextField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ vPropertiesMatrix(acTimeField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,30,31,37,38,39,40,41,42,44,45)
+ End Select
+
+Dim vProperties() As Variant, i As Integer, iIndex As Integer
+ If _ControlType = acSubForm Then iIndex = 0 Else iIndex = _ControlType
+ If IsEmpty(vPropertiesMatrix(iIndex)) Then
+ vProperties = Array()
+ Else
+ ReDim vProperties(0 To UBound(vPropertiesMatrix(iIndex)))
+ For i = 0 To UBound(vProperties)
+ vProperties(i) = vFullPropertiesList(vPropertiesMatrix(iIndex)(i))
+ Next i
+ End If
+
+ _PropertiesList = vProperties()
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return property value of the psProperty property name
+
+Dim vEMPTY As Variant, iArg As Integer
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Control.get&quot; &amp; psProperty)
+ _PropertyGet = vEMPTY
+
+&apos;Check Index argument
+Dim iArgNr As Integer
+ If Not IsMissing(pvIndex) Then
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;getProperty&quot;) : iArgNr = 3
+ Case UCase(&quot;Control.getProperty&quot;) : iArgNr = 2
+ Case UCase(&quot;Control.get&quot; &amp; psProperty) : iArgNr = 1
+ End Select
+ If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
+ End If
+
+Dim vDefaultValue As Variant, oDefaultValue As Object, vValue As Variant, oValue As Object, iIndex As Integer
+Dim lListIndex As Long, i As Integer, j As Integer, vCurrentValue As Variant, lListCount As Long
+Dim vListboxValue As Variant, vListSource, bSelected() As Boolean, bListboxBound As Boolean
+Dim vGet As Variant, vDate As Variant
+Dim ofSubForm As Object
+Dim vFormats() As Variant
+
+ If Not hasProperty(psProperty) Then Goto Trace_Error
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;BackColor&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;BackgroundColor&quot;) Then _PropertyGet = ControlModel.BackgroundColor
+ Case UCase(&quot;BorderColor&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then _PropertyGet = ControlModel.BorderColor
+ Case UCase(&quot;BorderStyle&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Border&quot;) Then _PropertyGet = ControlModel.Border
+ Case UCase(&quot;Cancel&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;PushButtonType&quot;) Then _PropertyGet = ( ControlModel.PushButtonType = com.sun.star.awt.PushButtonType.CANCEL )
+ Case UCase(&quot;Caption&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then _PropertyGet = ControlModel.Label
+ Case UCase(&quot;ControlSource&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;DataField&quot;) Then _PropertyGet = ControlModel.DataField
+ Case UCase(&quot;ControlTipText&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;HelpText&quot;) Then _PropertyGet = ControlModel.HelpText
+ Case UCase(&quot;ControlType&quot;)
+ _PropertyGet = _ControlType
+ Case UCase(&quot;Default&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultButton&quot;) Then _PropertyGet = ControlModel.DefaultButton
+ Case UCase(&quot;DefaultValue&quot;)
+ Select Case _SubType
+ Case CTLCHECKBOX, CTLCOMMANDBUTTON, CTLRADIOBUTTON
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then _PropertyGet = ControlModel.DefaultState
+ Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultText&quot;) Then _PropertyGet = ControlModel.DefaultText
+ Case CTLCURRENCYFIELD, CTLNUMERICFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultValue&quot;) Then _PropertyGet = ControlModel.DefaultValue
+ Case CTLDATEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultDate&quot;) Then
+ Select Case VarType(ControlModel.DefaultDate)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ vDefaultValue = ControlModel.DefaultDate
+ vGet = DateSerial(Left(vDefaultValue, 4), Mid(vDefaultValue, 5, 2), Right(vDefaultValue, 2))
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
+ Set oDefaultValue = ControlModel.DefaultDate
+ vGet = DateSerial(oDefaultValue.Year,oDefaultValue.Month, oDefaultValue.Day)
+ Case vbEmpty
+ End Select
+ End If
+ Case CTLFORMATTEDFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;EffectiveDefault&quot;) Then _PropertyGet = ControlModel.EffectiveDefault
+ Case CTLLISTBOX
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultSelection&quot;) And Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
+ vDefaultValue = ControlModel.DefaultSelection
+ If IsArray(vDefaultValue) Then
+ If UBound(vDefaultValue) &gt;= LBound(vDefaultValue) Then &apos; Is array initialized ?
+ iIndex = UBound(ControlModel.StringItemList)
+ If vDefaultValue(0) &gt;= 0 And vDefaultValue(0) &lt;= iIndex Then _PropertyGet = ControlModel.StringItemList(vDefaultValue(0))
+ &apos; Only first default value is considered
+ End If
+ End If
+ End If
+ Case CTLSPINBUTTON
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultSpinValue&quot;) Then _PropertyGet = ControlModel.DefaultSpinValue
+ Case CTLTIMEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;DefaultTime&quot;) Then
+ Select Case VarType(ControlModel.DefaultTime)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ _PropertyGet = ControlModel.DefaultTime
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
+ Set oDefaultValue = ControlModel.DefaultTime
+ _PropertyGet = TimeSerial(oDefaultValue.Hours, oDefaultValue.Minutes, oDefaultValue.Seconds)
+ Case vbEmpty
+ End Select
+ End If
+ Case Else
+ Goto Trace_Error
+ End Select
+ Case UCase(&quot;Enabled&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Enabled&quot;) Then _PropertyGet = ControlModel.Enabled
+ Case UCase(&quot;FontBold&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then _PropertyGet = ( ControlModel.FontWeight &gt;= com.sun.star.awt.FontWeight.BOLD )
+ Case UCase(&quot;FontItalic&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontSlant&quot;) Then _PropertyGet = ( ControlModel.FontSlant = com.sun.star.awt.FontSlant.ITALIC )
+ Case UCase(&quot;FontName&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontName&quot;) Then _PropertyGet = ControlModel.FontName
+ Case UCase(&quot;FontSize&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontHeight&quot;) Then _PropertyGet = ControlModel.FontHeight
+ Case UCase(&quot;FontUnderline&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontUnderline&quot;) Then _PropertyGet = _
+ Not ( ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.NONE _
+ Or ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.DONTKNOW )
+ Case UCase(&quot;FontWeight&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then _PropertyGet = ControlModel.FontWeight
+ Case UCase(&quot;ForeColor&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;TextColor&quot;) Then _PropertyGet = ControlModel.TextColor
+ Case UCase(&quot;Form&quot;)
+ Set ofSubForm = New SubForm &apos; Start building the SUBFORM object
+ Set ofSubForm.DatabaseForm = ControlModel
+ ofSubForm._Name = _Name
+ ofSubForm._Shortcut = _Shortcut &amp; &quot;.Form&quot;
+ ofSubForm.ParentComponent = _FormComponent
+ set _PropertyGet = ofSubForm
+ Case UCase(&quot;Format&quot;)
+ vFormats = _Formats(_Subtype)
+ Select Case _SubType
+ Case CTLDATEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;DateFormat&quot;) Then
+ If ControlModel.DateFormat &lt;= UBound(vFormats) Then _PropertyGet = vFormats(ControlModel.DateFormat)
+ End If
+ Case CTLTIMEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;TimeFormat&quot;) Then
+ If ControlModel.TimeFormat &lt;= UBound(vFormats) Then _PropertyGet = vFormats(ControlModel.TimeFormat)
+ End If
+ Case Else
+ If Utils._hasUNOProperty(ControlModel, &quot;FormatKey&quot;) Then
+ If Utils._hasUNOProperty(ControlModel, &quot;FormatsSupplier&quot;) Then
+ _PropertyGet = ControlModel.FormatsSupplier.getNumberFormats.getByKey(ControlModel.FormatKey).FormatString
+ End If
+ End If
+ End Select
+ Case UCase(&quot;ItemData&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
+ If IsMissing(pvIndex) Then
+ _PropertyGet = ControlModel.StringItemList
+ Else
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(ControlModel.StringItemList) Then Goto Trace_Error_Index
+ _PropertyGet = ControlModel.StringItemList(pvIndex)
+ End If
+ End If
+ Case UCase(&quot;ListCount&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then _PropertyGet = UBound(ControlModel.StringItemList) + 1
+ Case UCase(&quot;ListIndex&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
+ lListIndex = -1 &apos; Either Multiple selections or no selection at all
+ Select Case _SubType
+ Case CTLCOMBOBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then Goto Trace_Error
+ iIndex = 0
+ If ControlModel.Text &lt;&gt; &quot;&quot; Then
+ For j = 0 To UBound(ControlModel.StringItemList)
+ If ControlModel.StringItemList(j) = ControlModel.Text Then
+ lListIndex = j
+ iIndex = iIndex + 1
+ End If
+ Next j
+ If iIndex &lt;&gt; 1 Then lListIndex = -1 &apos; Multiselection or synonyms rejected
+ End If
+ Case CTLLISTBOX &apos; No mean found to access bound column !! See mail Lionel 10/5/2013 for improvement
+ If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
+ If UBound(ControlModel.SelectedItems) &gt; 0 Then &apos; Several items selected
+ Else &apos; Mono selection
+ If _ParentType &lt;&gt; CTLPARENTISDIALOG Then &apos; getCurrentValue not found in dialog listboxes ??
+ vCurrentValue = ControlModel.getCurrentValue() &apos; Space or uninitialized array if no selection at all
+ If IsArray(vCurrentValue) Then &apos; Is an array if MultiSelect
+ vListboxValue = &quot;&quot;
+ If UBound(vCurrentValue) = 0 Then vListboxValue = vCurrentValue(0)
+ Else
+ vListboxValue = vCurrentValue
+ End If
+ If vListboxValue &lt;&gt; &quot;&quot; Then &apos; Speed up search PM Pastim 12/02/2013
+ If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
+ End If
+ Else
+ If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
+ End If
+ End If
+ End Select
+ _PropertyGet = lListIndex
+ End If
+ Case UCase(&quot;Locked&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;ReadOnly&quot;) Then _PropertyGet = ControlModel.ReadOnly
+ Case UCase(&quot;MultiSelect&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
+ _PropertyGet = ControlModel.MultiSelection &apos; Boolean in OO, Integer (0, 1 or 2) in VBA
+ ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then &apos; Not documented: only for GridControls !? Changed in OO &gt;= 3,3 !?
+ _PropertyGet = ControlModel.MultiSelectionSimpleMode
+ Else
+ _PropertyGet = False
+ End If
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;OptionValue&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;RefValue&quot;) Then
+ If ControlModel.RefValue &lt;&gt; &quot;&quot; Then
+ _PropertyGet = ControlModel.RefValue
+ ElseIf Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then
+ _PropertyGet = ControlModel.Label
+ End If
+ End If
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Page&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Step&quot;) Then _PropertyGet = ControlModel.Step
+ Case UCase(&quot;Parent&quot;)
+ Set _PropertyGet = PropertiesGet._ParentObject(_Shortcut)
+ Case UCase(&quot;Required&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;InputRequired&quot;) Then _PropertyGet = ControlModel.InputRequired
+ Case UCase(&quot;RowSource&quot;)
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG
+ If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
+ If IsArray(ControlModel.StringItemList) Then vListSource = ControlModel.StringItemList Else vListSource = Array(ControlModel.StringItemList)
+ _PropertyGet = Join(vListSource, &quot;;&quot;)
+ End If
+ Case Else
+ If Utils._hasUNOProperty(ControlModel, &quot;ListSource&quot;) Then
+ Select Case ControlModel.ListSourceType
+ Case com.sun.star.form.ListSourceType.VALUELIST _
+ , com.sun.star.form.ListSourceType.TABLEFIELDS
+ If IsArray(ControlModel.StringItemList) Then vListSource = ControlModel.StringItemList Else vListSource = Array(ControlModel.StringItemList)
+ Case com.sun.star.form.ListSourceType.TABLE _
+ , com.sun.star.form.ListSourceType.QUERY _
+ , com.sun.star.form.ListSourceType.SQL _
+ , com.sun.star.form.ListSourceType.SQLPASSTHROUGH
+ If IsArray(ControlModel.ListSource) Then vListSource = ControlModel.ListSource Else vListSource = Array(ControlModel.ListSource)
+ End Select
+ _PropertyGet = Join(vListSource, &quot;;&quot;)
+ End If
+ End Select
+ Case UCase(&quot;RowSourceType&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;ListSourceType&quot;) Then _PropertyGet = ControlModel.ListSourceType
+ Case UCase(&quot;Selected&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
+ lListIndex = UBound(ControlModel.StringItemList)
+ If Not IsMissing(pvIndex) Then
+ If pvIndex &lt; 0 Or pvIndex &gt; lListIndex Then Goto Trace_Error_Index
+ End If
+ If lListIndex &lt; 0 Then &apos; Do nothing if listbox empty
+ _PropertyGet = Array()
+ Else
+ Redim bSelected(0 To lListIndex)
+ For j = 0 To lListIndex
+ bSelected(j) = False
+ Next j
+ For j = 0 To UBound(ControlModel.SelectedItems)
+ iIndex = ControlModel.SelectedItems(j)
+ If iIndex &gt;= 0 And iIndex &lt;= lListIndex Then bSelected(iIndex) = True
+ Next j
+ If IsMissing(pvIndex) Then _PropertyGet = bSelected Else _PropertyGet = bSelected(pvIndex)
+ End If
+ End If
+ Case UCase(&quot;SpecialEffect&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;VisualEffect&quot;) Then _PropertyGet = ControlModel.VisualEffect
+ Case UCase(&quot;SubType&quot;)
+ _PropertyGet = _SubType
+ Case UCase(&quot;TabIndex&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;TabIndex&quot;) Then _PropertyGet = ControlModel.TabIndex
+ Case UCase(&quot;TabStop&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;TabStop&quot;) Then _PropertyGet = ControlModel.TabStop
+ Case UCase(&quot;Tag&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then _PropertyGet = ControlModel.Tag
+ Case UCase(&quot;Text&quot;)
+ Select Case _SubType
+ Case CTLDATEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then
+ If Utils._hasUNOProperty(ControlModel, &quot;FormatKey&quot;) Then
+ If Utils._hasUNOProperty(ControlModel, &quot;FormatsSupplier&quot;) Then
+ Select Case VarType(ControlModel.Date)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ vDate = DateSerial(Left(ControlModel.Date, 4), Mid(ControlModel.Date, 5, 2), Right(ControlModel.Date, 2))
+ Case vbObject &apos; LO &gt;= 4.2
+ vDate = DateSerial(ControlModel.Date.Year, ControlModel.Date.Month, ControlModel.Date.Day)
+ Case vbEmpty
+ End Select
+ _PropertyGet = Format(vDate, ControlModel.FormatsSupplier.getNumberFormats.getByKey(ControlModel.FormatKey).FormatString)
+ End If
+ End If
+ End If
+ Case CTLTIMEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then
+ Select Case VarType(ControlModel.Time)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ _PropertyGet = Format(ControlModel.Time, &quot;HH:MM:SS&quot;)
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
+ Set oValue = ControlModel.Time
+ _PropertyGet = Format(TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds), &quot;HH:MM:SS&quot;)
+ Case vbEmpty
+ End Select
+ End If
+ Case Else
+ If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then _PropertyGet = ControlModel.Text
+ End Select
+ Case UCase(&quot;TextAlign&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then _PropertyGet = ControlModel.Tag
+ Case UCase(&quot;TripleState&quot;)
+ If Utils._hasUNOProperty(ControlModel, &quot;TriState&quot;) Then _PropertyGet = ControlModel.TriState
+ Case UCase(&quot;Value&quot;)
+ Select Case _SubType
+ Case CTLCHECKBOX
+ If Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then vGet = ControlModel.State
+ Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then vGet = ControlModel.Text
+ Case CTLCURRENCYFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then vGet = ControlModel.Value
+ Case CTLDATEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then
+ Select Case VarType(ControlModel.Date)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ vValue = ControlModel.Date
+ vGet = DateSerial(Left(vValue, 4), Mid(vValue, 5, 2), Right(vValue, 2))
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
+ Set oValue = ControlModel.Date
+ vGet = DateSerial(oValue.Year, oValue.Month, oValue.Day)
+ Case vbEmpty
+ End Select
+ End If
+ Case CTLFORMATTEDFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;EffectiveValue&quot;) Then vGet = ControlModel.EffectiveValue
+ Case CTLHIDDENCONTROL
+ If Utils._hasUNOProperty(ControlModel, &quot;HiddenValue&quot;) Then vGet = ControlModel.HiddenValue
+ Case CTLLISTBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
+ If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
+ If UBound(ControlModel.SelectedItems) &gt; 0 Then &apos; Several items selected
+ vGet = vEMPTY &apos; Listbox has no value, only an array of Selected flags to identify values
+ Else &apos; Mono selection
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG
+ If Ubound(ControlModel.SelectedItems) &gt;= 0 Then
+ lListIndex = Controlmodel.Selecteditems(0)
+ If lListIndex &gt; -1 And lListIndex &lt;= UBound(ControlModel.StringItemList) Then
+ vGet = ControlModel.StringItemList(lListIndex)
+ Else
+ vGet = vEMPTY
+ End If
+ End If
+ Case Else
+ vCurrentValue = ControlModel.getCurrentValue() &apos; Space or uninitialized array if no selection at all
+ If IsArray(vCurrentValue) Then &apos; Is an array if MultiSelect
+ If UBound(vCurrentValue) &gt;= LBound(vCurrentValue) Then
+ vListboxValue = vCurrentValue(0)
+ Else
+ vListboxValue = &quot;&quot;
+ End If
+ Else
+ vListboxValue = vCurrentValue
+ End If
+ lListIndex = -1 &apos; Speed up getting value PM PASTIM 12/02/2013
+ If vListboxValue &lt;&gt; &quot;&quot; Then
+ If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
+ End If
+ &apos; If listbox has hidden column = real bound field, then explore ValueItemList
+ bListboxBound = _ListboxBound()
+ If bListboxBound Then
+ If lListIndex &gt; -1 Then vGet = ControlModel.ValueItemList(lListIndex) &apos; PASTIM
+ Else
+ vGet = vListboxValue
+ End If
+ End Select
+ End If
+ Case CTLNUMERICFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then vGet = ControlModel.Value
+ Case CTLPROGRESSBAR
+ If Utils._hasUNOProperty(ControlModel, &quot;ProgressValue&quot;) Then vGet = ControlModel.ProgressValue
+ Case CTLSCROLLBAR
+ If Utils._hasUNOProperty(ControlModel, &quot;ScrollValue&quot;) Then vGet = ControlModel.ScrollValue
+ Case CTLSPINBUTTON
+ If Utils._hasUNOProperty(ControlModel, &quot;SpinValue&quot;) Then vGet = ControlModel.SpinValue
+ Case CTLTIMEFIELD
+ If Utils._hasUNOProperty(ControlModel, &quot;Time&quot;) Then
+ Select Case VarType(ControlModel.Time)
+ Case vbLong &apos; AOO and LO &lt;= 4.1
+ vGet = ControlModel.Time
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
+ Set oValue = ControlModel.Time
+ vGet = TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds)
+ Case vbEmpty
+ End Select
+ End If
+ Case Else
+ End Select
+ If _SubType &lt;&gt; CTLLISTBOX Then &apos; Give getCurrentValue an additional try
+ If IsEmpty(vGet) And Utils._hasUNOMethod(ControlModel, &quot;getCurrentValue&quot;) Then vGet = ControlModel.getCurrentValue()
+ End If
+ _PropertyGet = vGet
+ Case UCase(&quot;Visible&quot;)
+ Select Case _SubType
+ Case CTLHIDDENCONTROL
+ _PropertyGet = False
+ Case Else
+ If Utils._hasUNOMethod(ControlView, &quot;isVisible&quot;) Then _PropertyGet = CBool(ControlView.isVisible())
+ End Select
+ Case Else
+ Goto Trace_Error
+ End Select
+
+ If IsEmpty(_PropertyGet) Then TraceError(TRACEINFO, ERRPROPERTYINIT, Utils._CalledSub(), 0, , psProperty)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
+&apos; Return True if property setting OK
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Control.set&quot; &amp; psProperty)
+ _PropertySet = True
+
+&apos;Check Index argument
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric()) Then Goto Exit_Function
+ End If
+&apos;Execute
+Dim iArgNr As Integer, vButton As Variant, i As Integer
+Dim odbDatabase As Object, vNames() As Variant, bFound As Boolean, sName As String
+Dim bMultiSelect As Boolean, iCount As Integer, iSelectedItems() As Integer, lListCount As Long, bSelected() As Boolean
+Dim vItemList() As Variant, vFormats() As Variant
+Dim oStruct As Object, sValue As String
+
+ _PropertySet = True
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;setProperty&quot;) : iArgNr = 3
+ Case UCase(&quot;Control.setProperty&quot;) : iArgNr = 2
+ Case UCase(&quot;Control.set&quot; &amp; psProperty) : iArgNr = 1
+ End Select
+
+ If Not hasProperty(psProperty) Then Goto Trace_Error
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;BackColor&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;BackgroundColor&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.BackgroundColor = CLng(pvValue)
+ Case UCase(&quot;BorderColor&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.BorderColor = CLng(pvValue)
+ Case UCase(&quot;BorderStyle&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = No border, 1 = 3D border, 2 = Normal border
+ ControlModel.Border = CLng(pvValue)
+ Case UCase(&quot;Cancel&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;PushButtonType&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If pvValue Then vButton = com.sun.star.awt.PushButtonType.CANCEL Else vButton = com.sun.star.awt.PushButtonType.STANDARD
+ ControlModel.PushButtonType = vButton
+ Case UCase(&quot;Caption&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.Label = pvValue
+ Case UCase(&quot;ControlTipText&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;HelpText&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.HelpText = pvValue
+ Case UCase(&quot;Default&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultButton&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.DefaultButton = pvValue
+ Case UCase(&quot;DefaultValue&quot;)
+ Select Case _SubType
+ Case CTLDATEFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultDate&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
+ Select Case VarType(ControlModel.DefaultDate)
+ Case vbEmpty, vbLong &apos; AOO and LO &lt;= 4.1
+ ControlModel.DefaultDate = Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue)
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
+ ControlModel.DefaultDate.Year = Year(pvValue)
+ ControlModel.DefaultDate.Month = Month(pvValue)
+ ControlModel.DefaultDate.Day = Day(pvValue)
+ End Select
+ Case CTLLISTBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultSelection&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ For i = 0 To UBound(ControlModel.StringItemList)
+ If UCase(pvValue) = UCase(ControlModel.StringItemList(i)) Then
+ ControlModel.DefaultSelection = Array(i)
+ Exit For
+ End If
+ Next i
+ Case CTLSPINBUTTON
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultSpinValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.DefaultSpinValue = pvValue
+ Case CTLCHECKBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked 2 = don&apos;t know
+ ControlModel.DefaultState = pvValue
+ Case CTLRADIOBUTTON
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; 1 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked
+ ControlModel.DefaultState = pvValue
+ Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultText&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.DefaultText = pvValue
+ Case CTLTIMEFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultTime&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &gt;= 0 And pvValue &lt;= 23595999 Then
+ Select Case VarType(ControlModel.DefaultTime)
+ Case vbEmpty, vbLong &apos; AOO and LO &lt;= 4.1
+ ControlModel.DefaultTime = pvValue
+ Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
+ ControlModel.DefaultDate.Hours = Hour(pvValue)
+ ControlModel.DefaultDate.Minutes = Minute(pvValue)
+ ControlModel.DefaultDate.Seconds = Second(pvValue)
+ End Select
+ Else Goto Trace_Error_Value
+ End If
+ Case CTLCURRENCYFIELD, CTLNUMERICFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.DefaultValue = pvValue
+ Case CTLFORMATTEDFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;EffectiveDefault&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.EffectiveDefault = pvValue &apos; Thanks, PASTIM
+ Case Else
+ Goto Trace_Error
+ End Select
+ Case UCase(&quot;Enabled&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Enabled&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.Enabled = pvValue
+ Case UCase(&quot;FontBold&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If pvValue Then &apos; Iif construction does not work !
+ ControlModel.FontWeight = com.sun.star.awt.FontWeight.BOLD
+ Else
+ ControlModel.FontWeight = com.sun.star.awt.FontWeight.NORMAL
+ End If
+ Case UCase(&quot;FontItalic&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontSlant&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If pvValue Then &apos; Iif construction does not work !
+ ControlModel.FontSlant = com.sun.star.awt.FontSlant.ITALIC
+ Else
+ ControlModel.FontSlant = com.sun.star.awt.FontSlant.NONE
+ End If
+ Case UCase(&quot;FontName&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontName&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.FontName = pvValue
+ Case UCase(&quot;FontSize&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontHeight&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 1 Or pvValue &gt; 127 Then Goto Trace_Error_Value
+ ControlModel.FontHeight = pvValue
+ Case UCase(&quot;FontUnderline&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontUnderline&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If pvValue Then &apos; Iif construction does not work !
+ ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.SINGLE
+ Else
+ ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.NONE
+ End If
+ Case UCase(&quot;FontWeight&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then Goto Trace_Error
+ If Not Utils._IsScalar(CSng(pvValue), vbSingle, Array( _
+ com.sun.star.awt.FontWeight.THIN _
+ , com.sun.star.awt.FontWeight.ULTRALIGHT _
+ , com.sun.star.awt.FontWeight.LIGHT _
+ , com.sun.star.awt.FontWeight.SEMILIGHT _
+ , com.sun.star.awt.FontWeight.NORMAL _
+ , com.sun.star.awt.FontWeight.SEMIBOLD _
+ , com.sun.star.awt.FontWeight.BOLD _
+ , com.sun.star.awt.FontWeight.ULTRABOLD _
+ , com.sun.star.awt.FontWeight.BLACK _
+ )) Then Goto Trace_Error_Value
+ ControlModel.FontWeight = pvValue
+ Case UCase(&quot;Format&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ vFormats = _Formats(_SubType)
+ Select Case _SubType
+ Case CTLDATEFIELD, CTLTIMEFIELD
+ bFound = False
+ For i = 0 To UBound(vFormats)
+ If UCase(pvValue) = UCase(vFormats(i)) Then
+ If _SubType = CTLDATEFIELD Then
+ If Utils._hasUNOProperty(ControlModel, &quot;DateFormat&quot;) Then ControlModel.DateFormat = i Else Goto Trace_Error
+ Else
+ If Utils._hasUNOProperty(ControlModel, &quot;TimeFormat&quot;) Then ControlModel.TimeFormat = i Else Goto Trace_Error
+ End If
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_Error_Value
+ Case Else
+ Goto Trace_Error
+ End Select
+ Case UCase(&quot;ForeColor&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;TextColor&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.TextColor = CLng(pvValue)
+ Case UCase(&quot;ListIndex&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; UBound(ControlModel.StringItemList) Then Goto Trace_Error_Value
+ Select Case _SubType
+ Case CTLCOMBOBOX
+ ControlModel.Text = ControlModel.StringItemList(pvValue)
+ Case CTLLISTBOX
+ ControlModel.SelectedItems = Array(pvValue)
+ End Select
+ Case UCase(&quot;Locked&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ReadOnly&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.ReadOnly = pvValue
+ Case UCase(&quot;MultiSelect&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) And Not Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
+ ControlModel.MultiSelection = pvValue
+ ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then
+ ControlModel.MultiSelectionSimpleMode = pvValue
+ End If
+ If Not pvValue Then ControlModel.SelectedItems = Array() &apos; Cancel selections when MultiSelect becomes False
+ Case UCase(&quot;OptionValue&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;RefValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then
+ If pvValue = &quot;&quot; Then Goto Trace_Error_Value
+ If ControlModel.RefValue &lt;&gt; &quot;&quot; Then ControlModel.RefValue = pvValue
+ Else
+ ControlModel.Label = pvValue
+ End If
+ Case UCase(&quot;Page&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Step&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Then Goto Trace_Error_Value
+ ControlModel.Step = pvValue
+ Case UCase(&quot;Required&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;InputRequired&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.InputRequired = pvValue
+ Case UCase(&quot;RowSource&quot;)
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG
+ If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
+ ControlModel.StringItemList = Split(pvValue, &quot;;&quot;)
+ Case Else
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ListSource&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ Select Case ControlModel.ListSourceType
+ Case com.sun.star.form.ListSourceType.QUERY _
+ , com.sun.star.form.ListSourceType.TABLE _
+ , com.sun.star.form.ListSourceType.TABLEFIELDS
+ Set odbDatabase = Application._CurrentDb()
+ If ControlModel.ListSourceType = com.sun.star.form.ListSourceType.QUERY Then vNames = odbDatabase.Connection.getQueries.GetElementNames _
+ Else vNames = odbDatabase.Connection.getTables.GetElementNames
+ bFound = False &apos; Check existence of table or query and find its correct (case-sensitive) name
+ For i = 0 To UBound(vNames)
+ If UCase(vNames(i)) = UCase(pvValue) Then
+ bFound = True
+ sName = vNames(i)
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_Error_Value
+ If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = sName Else ControlModel.ListSource = Array(sName)
+ ControlModel.refresh()
+ Case com.sun.star.form.ListSourceType.SQL
+ If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = Utils._ReplaceSquareBrackets(pvValue) Else ControlModel.ListSource = Array(Utils._ReplaceSquareBrackets(pvValue))
+ ControlModel.refresh()
+ Case com.sun.star.form.ListSourceType.VALUELIST &apos; Forbidden for COMBOBOX !
+ If _SubType = CTLCOMBOBOX Then Goto Trace_Error
+ ControlModel.ListSource = Split(pvValue, &quot;;&quot;)
+ ControlModel.StringItemList = ControlModel.ListSource
+ Case com.sun.star.form.ListSourceType.SQLPASSTHROUGH
+ If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = pvValue Else ControlModel.ListSource = Array(pvValue)
+ ControlModel.refresh()
+ End Select
+ End Select
+ If _SubType = CTLLISTBOX Then ControlModel.SelectedItems = Array()
+ Case UCase(&quot;RowSourceType&quot;) &apos; Refresh done when RowSource changes, not RowSourceType
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ListSourceType&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Not Utils._IsScalar(pvValue, Utils._AddNumeric(), Array( _
+ com.sun.star.form.ListSourceType.VALUELIST _
+ , com.sun.star.form.ListSourceType.TABLE _
+ , com.sun.star.form.ListSourceType.QUERY _
+ , com.sun.star.form.ListSourceType.SQL _
+ , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
+ , com.sun.star.form.ListSourceType.TABLEFIELDS _
+ )) Then Goto Trace_Error_Value
+ ControlModel.ListSourceType = pvValue
+ Case UCase(&quot;Selected&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
+ If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
+ If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
+ bMultiSelect = ControlModel.MultiSelection
+ ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then
+ bMultiSelect = ControlModel.MultiSelectionSimpleMode
+ Else: Goto Trace_Error
+ End If
+ lListCount = UBound(ControlModel.StringItemList) + 1
+ If IsMissing(pvIndex) Then &apos; Full boolean array passed
+ If Not IsArray(pvValue) Then Goto Trace_Error_Array
+ If LBound(pvValue) &lt;&gt; 0 Or UBound(pvValue) &lt; 0 Then Goto Trace_Error_Array
+ If Not Utils._CheckArgument(pvValue(0), iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If UBound(pvValue) &lt;&gt; lListCount - 1 Then Goto Trace_Error_Index
+ iCount = 0
+ For i = 0 To UBound(pvValue) &apos; Count True values
+ If pvValue(i) Then iCount = iCount + 1
+ Next i
+ If iCount &gt; 0 Then
+ Redim iSelectedItems(0 To iCount - 1)
+ iCount = 0
+ For i = 0 To UBound(pvValue)
+ If pvValue(i) Then
+ iSelectedItems(iCount) = i
+ iCount = iCount + 1
+ End If
+ Next i
+ ControlModel.SelectedItems = iSelectedItems &apos; iSelectedItems maps OO internals (size = # of selected items)
+ Else
+ ControlModel.SelectedItems = Array()
+ End If
+ Else &apos; Single boolean value passed
+ If Not Utils._CheckArgument(pvIndex, iArgNr + 1, Utils._AddNumeric()) Then Goto Exit_Function
+ If pvIndex &lt; 0 Or pvIndex &gt;= lListCount Then Goto Trace_Error_Index
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ReDim bSelected(0 To lListCount - 1) &apos; bSelected maps VBA internals (size = # of displayed items)
+ If Not bMultiSelect Then &apos; Set all other values to False
+ For i = 0 To lListCount - 1
+ If i = pvIndex Then
+ bSelected(i) = pvValue &apos; All entries = False except one
+ Else
+ bSelected(i) = False
+ End If
+ Next i
+ Else
+ For i = 0 To lListCount - 1
+ bSelected(i) = False
+ Next i
+ iSelectedItems = ControlModel.SelectedItems
+ iCount = UBound(iSelectedItems)
+ For i = 0 To iCount
+ bSelected(iSelectedItems(i)) = True
+ Next i
+ bSelected(pvIndex) = pvValue
+ End If
+ iCount = 0 &apos; Rebuild SelectedItems
+ For i = 0 To lListCount - 1
+ If bSelected(i) Then iCount = iCount + 1
+ Next i
+ If iCount &gt; 0 Then
+ Redim iSelectedItems(0 To iCount - 1)
+ iCount = 0
+ For i = 0 To lListCount - 1
+ If bSelected(i) Then
+ iSelectedItems(iCount) = i
+ iCount = iCount + 1
+ End If
+ Next i
+ ControlModel.SelectedItems = iSelectedItems
+ Else
+ ControlModel.SelectedItems = Array()
+ End If
+ End If
+ Case UCase(&quot;SpecialEffect&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;VisualEffect&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = None, 1 = Look3D, 2 = Flat
+ ControlModel.VisualEffect = pvValue
+ Case UCase(&quot;TabIndex&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;TabIndex&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; -1 Then Goto Trace_Error_Value
+ ControlModel.TabIndex = pvValue
+ Case UCase(&quot;TabStop&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Tabstop&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.Tabstop = pvValue
+ Case UCase(&quot;Tag&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.Tag = pvValue
+ Case UCase(&quot;TextAlign&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Align&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Left, 1 = Center, 2 = Right
+ ControlModel.Align = pvValue
+ Case UCase(&quot;TripleState&quot;)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;TriState&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ControlModel.TriState = pvValue
+ Case UCase(&quot;Value&quot;)
+ Select Case _SubType
+ Case CTLCHECKBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(vbBoolean), , False) Then Goto Trace_Error_Value
+ If VarType(pvValue) = vbBoolean Then pvValue = Iif(pvValue, 1, 0)
+ If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked 2 = don&apos;t know
+ ControlModel.State = pvValue
+ Case CTLCOMBOBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) _
+ Then Goto Trace_Error
+ If pvValue &lt;&gt; &quot;&quot; Then
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, ControlModel.StringItemList, False) Then Goto Trace_Error_Value
+ End If
+ ControlModel.Text = pvValue
+ Case CTLCURRENCYFIELD, CTLNUMERICFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ControlModel.Value = pvValue
+ Case CTLDATEFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
+ Select Case _InspectPropertyType(ControlModel, &quot;Date&quot;)
+ Case &quot;long&quot; &apos; AOO and LO &lt;= 4.1
+ &apos;ControlModel.Date = Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue) &apos; Gives error in dialogs ?!?
+ ControlModel.setPropertyValue(&quot;Date&quot;, Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue))
+ Case &quot;com.sun.star.util.Date&quot; &apos; LO &gt;= 4.2
+ &apos;Direct assignment of ControlModel.Date.Xxx has no effect ?!?
+ Set oStruct = CreateUnoStruct(&quot;com.sun.star.util.Date&quot;)
+ oStruct.Year = Year(pvValue)
+ oStruct.Month = Month(pvValue)
+ oStruct.Day = Day(pvValue)
+ Set ControlModel.Date = oStruct
+ End Select
+ Case CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ ControlModel.Text = pvValue
+ Case CTLFORMATTEDFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;EffectiveValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(vbString), , False) Then Goto Trace_Error_Value
+ ControlModel.EffectiveValue = pvValue
+ Case CTLHIDDENCONTROL
+ If Not Utils._hasUNOProperty(ControlModel, &quot;HiddenValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(Array(vbString, vbBoolean, vbDate)), , False) Then Goto Trace_Error_Value
+ ControlModel.HiddenValue = pvValue
+ Case CTLLISTBOX
+ If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) _
+ Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(Array(vbString, vbDate)), , False) Then Goto Trace_Error_Value &apos; PASTIM
+ If IsArray(pvValue) Then Goto Trace_Error_Value &apos; Setting the value on a listbox is allowed only if single value and value in the list
+ &apos; Check ValueItemList
+ bFound = False
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG
+ vItemList = ControlModel.StringItemList
+ Case Else
+ If _ListboxBound() Then &apos; Performance improvement (PASTIM PM 9 Feb 2013)
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ValueItemList&quot;) Then Goto Trace_Error
+ vItemList = ControlModel.ValueItemList
+ Else
+ vItemList = ControlModel.StringItemList
+ End If
+ End Select
+ For i = 0 To UBound(vItemList)
+ If pvValue = vItemList(i) Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then ControlModel.SelectedItems = Array(i) Else Goto Trace_Error_Value
+ Case CTLPROGRESSBAR
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ProgressValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Utils._hasUNOProperty(ControlModel, &quot;ProgressValueMin&quot;) Then
+ If pvValue &lt; ControlModel.ProgressValueMin Then Goto Trace_Error_Value
+ End If
+ If Utils._hasUNOProperty(ControlModel, &quot;ProgressValueMax&quot;) Then
+ If pvValue &gt; ControlModel.ProgressValueMax Then Goto Trace_Error_Value
+ End If
+ ControlModel.ProgressValue = pvValue
+ Case CTLSCROLLBAR
+ If Not Utils._hasUNOProperty(ControlModel, &quot;ScrollValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Utils._hasUNOProperty(ControlModel, &quot;ScrollValueMin&quot;) Then
+ If pvValue &lt; ControlModel.ScrollValueMin Then Goto Trace_Error_Value
+ End If
+ If Utils._hasUNOProperty(ControlModel, &quot;ScrollValueMax&quot;) Then
+ If pvValue &gt; ControlModel.ScrollValueMax Then Goto Trace_Error_Value
+ End If
+ ControlModel.ScrollValue = pvValue
+ Case CTLSPINBUTTON
+ If Not Utils._hasUNOProperty(ControlModel, &quot;SpinValue&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Utils._hasUNOProperty(ControlModel, &quot;SpinValueMin&quot;) Then
+ If pvValue &lt; ControlModel.SpinValueMin Then Goto Trace_Error_Value
+ End If
+ If Utils._hasUNOProperty(ControlModel, &quot;SpinValueMax&quot;) Then
+ If pvValue &gt; ControlModel.SpinValueMax Then Goto Trace_Error_Value
+ End If
+ ControlModel.SpinValue = pvValue
+ Case CTLTIMEFIELD
+ If Not Utils._hasUNOProperty(ControlModel, &quot;Time&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ Select Case _InspectPropertyType(ControlModel, &quot;Time&quot;)
+ Case &quot;long&quot; &apos; AOO and LO &lt;= 4.0
+ ControlModel.Time = CLng(pvValue)
+ Case &quot;com.sun.star.util.Time&quot; &apos; LO &gt;= 4.1
+ &apos;Direct assignment of ControlModel.Time.Xxx gives error ?!?
+ Set oStruct = CreateUnoStruct(&quot;com.sun.star.util.Time&quot;)
+ sValue = Right(&quot;00000000&quot; &amp; Str(CLng(pvValue)), 8)
+ oStruct.Hours = Val(Left(sValue, 2))
+ oStruct.Minutes = Val(Mid(sValue, 3, 2))
+ oStruct.Seconds = Val(Mid(sValue, 5, 2))
+ Set ControlModel.Time = oStruct
+ End Select
+ Case Else
+ Goto Trace_Error
+ End Select
+ &apos; FINAL COMMITMENT
+ If Utils._hasUNOMethod(ControlModel, &quot;commit&quot;) Then ControlModel.commit() &apos; f.i. checkboxes have no commit method ?? [PASTIM]
+ Case UCase(&quot;Visible&quot;)
+ If _SubType = CTLHIDDENCONTROL Then Goto Trace_Error &apos; Hidden remains hidden !!
+ If Not Utils._hasUNOMethod(ControlView, &quot;setVisible&quot;) Then Goto Trace_Error
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ If pvValue Then ControlModel.EnableVisible = True
+ ControlView.setVisible(pvValue)
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Control.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Array:
+ TraceError(TRACEFATAL, ERRPROPERTYNOTARRAY, Utils._CalledSub(), 0, 1, iArgNr)
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Control._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet V1.0.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set BackColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BackColor&quot;, pvValue)
+End Property &apos; BackColor (set)
+
+Property Set BorderColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BorderColor&quot;, pvValue)
+End Property &apos; BorderColor (set)
+
+Property Set BorderStyle(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;BorderStyle&quot;, pvValue)
+End Property &apos; BorderStyle (set)
+
+Property Set Cancel(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Cancel&quot;, pvValue)
+End Property &apos; Cancel (set)
+
+Property Set Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+Property Set ControlTipText(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ControlTipText&quot;, pvValue)
+End Property &apos; ControlTipText (set)
+
+Property Set Default(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Default&quot;, pvValue)
+End Property &apos; Default (set)
+
+Property Set DefaultValue(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;DefaultValue&quot;, pvValue)
+End Property &apos; DefaultValue (set)
+
+Property Set Enabled(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Enabled&quot;, pvValue)
+End Property &apos; Enabled (set)
+
+Property Set FontBold(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontBold&quot;, pvValue)
+End Property &apos; FontBold (set)
+
+Property Set FontItalic(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontItalic&quot;, pvValue)
+End Property &apos; FontItalic (set)
+
+Property Set FontName(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontName&quot;, pvValue)
+End Property &apos; FontName (set)
+
+Property Set FontSize(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontSize&quot;, pvValue)
+End Property &apos; FontSize (set)
+
+Property Set FontUnderline(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontUnderline&quot;, pvValue)
+End Property &apos; FontUnderline (set)
+
+Property Set FontWeight(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FontWeight&quot;, pvValue)
+End Property &apos; FontWeight (set)
+
+Property Set ForeColor(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ForeColor&quot;, pvValue)
+End Property &apos; ForeColor (set)
+
+Property Set Format(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Format&quot;, pvValue)
+End Property &apos; Format (set)
+
+Property Set ListIndex(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;ListIndex&quot;, pvValue)
+End Property &apos; ListIndex (set)
+
+Property Set Locked(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Locked&quot;, pvValue)
+End Property &apos; Locked (set)
+
+Property Set MultiSelect(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;MultiSelect&quot;, pvValue)
+End Property &apos; MultiSelect (set)
+
+Property Set OptionValue(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;OptionValue&quot;, pvValue)
+End Property &apos; OptionValue (set)
+
+Property Set Page(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Page&quot;, pvValue)
+End Property &apos; Page (set)
+
+Property Set Required(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Required&quot;, pvValue)
+End Property &apos; Required (set)
+
+Property Set RowSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RowSource&quot;, pvValue)
+End Property &apos; RowSource (set)
+
+Property Set RowSourceType(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RowSourceType&quot;, pvValue)
+End Property &apos; RowSourceType (set)
+
+Property Set Selected(ByVal pvValue As Variant) &apos; , ByVal Optional pvIndex As Variant)
+&apos; If IsMissing(pvIndex) Then Call _PropertySet(&quot;Selected&quot;, pvValue) Else Call _PropertySet(&quot;Selected&quot;, pvValue, pvIndex)
+ Call _PropertySet(&quot;Selected&quot;, pvValue)
+End Property &apos; Selected (set)
+
+Property Set SpecialEffect(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;SpecialEffect&quot;, pvValue)
+End Property &apos; SpecialEffect (set)
+
+Property Set TabIndex(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TabIndex&quot;, pvValue)
+End Property &apos; TabIndex (set)
+
+Property Set TabStop(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TabStop&quot;, pvValue)
+End Property &apos; TabStop (set)
+
+Property Set Tag(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Tag&quot;, pvValue)
+End Property &apos; Tag (set)
+
+Property Set TextAlign(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TextAlign&quot;, pvValue)
+End Property &apos; TextAlign (set)
+
+Property Set TripleState(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;TripleState&quot;, pvValue)
+End Property &apos; TripleState (set)
+
+Property Set Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+Property Set Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/DataDef.xba b/wizards/source/access2base/DataDef.xba
new file mode 100644
index 000000000000..ed8b386466d5
--- /dev/null
+++ b/wizards/source/access2base/DataDef.xba
@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DataDef" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be TABLEDEF or QUERYDEF
+Private _Name As String
+Private Table As Object &apos; com.sun.star.sdb.dbaccess.ODBTable
+Private Query As Object &apos; com.sun.star.sdb.dbaccess.OQuery
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = &quot;&quot;
+ _Name = &quot;&quot;
+ Set Table = Nothing
+ Set Query = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SQL() As Variant
+ SQL = _PropertyGet(&quot;SQL&quot;)
+End Property &apos; SQL (get)
+
+Property Let SQL(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;SQL&quot;, pvValue)
+End Property &apos; SQL (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get pType() As Integer
+ pType = _PropertyGet(&quot;Type&quot;)
+End Property &apos; Type (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Execute(ByVal Optional pvOptions As Variant) As Boolean
+&apos;Execute a stored query. The query must be an ACTION query.
+
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.Execute&quot;
+ Utils._SetCalledSub(cstThisSub)
+ On Local Error Goto Error_Function
+Const cstNull = -1
+ Execute = False
+ If _Type &lt;&gt; OBJQUERYDEF Then Goto Trace_Method
+ If IsMissing(pvOptions) Then
+ pvOptions = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOptions, 1, Utils._AddNumeric(), dbSQLPassThrough) Then Goto Exit_Function
+ End If
+
+ &apos;Check action query
+Dim oDatabase As Object, oStatement As Object, vResult As Variant
+Dim iType As Integer, sSql As String
+ iType = pType
+ If ( (iType And DBQAction) = 0 ) And ( (iType And DBQDDL) = 0 ) Then Goto Trace_Action
+
+ &apos;Execute action query
+ Set oDatabase = Application._CurrentDb()
+ Set oStatement = oDatabase.Connection.createStatement()
+ sSql = Query.Command
+ If pvOptions = dbSQLPassThrough Then oStatement.EscapeProcessing = False _
+ Else oStatement.EscapeProcessing = True
+ On Local Error Goto SQL_Error
+ vResult = oStatement.executeUpdate(Utils._ReplaceSquareBrackets(sSql))
+ On Local Error Goto Error_Function
+
+ Execute = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Method:
+ TraceError(TRACEFATAL, ERRMETHOD, cstThisSub, 0, , cstThisSub)
+ Goto Exit_Function
+Trace_Action:
+ TraceError(TRACEFATAL, ERRNOTACTIONQUERY, cstThisSub, 0, , _Name)
+ Goto Exit_Function
+SQL_Error:
+ TraceError(TRACEFATAL, ERRSQLSTATEMENT, Utils._CalledSub(), 0, , sSql)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function &apos; Execute
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Fields(ByVal Optional pvIndex As variant) As Object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.Fields&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+ Set Fields = Nothing
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+Dim sObjects() As String, sObjectName As String, oObject As Object
+Dim i As Integer, bFound As Boolean, oFields As Object
+
+ If _Type = OBJTABLEDEF Then Set oFields = Table.getColumns() Else Set oFields = Query.getColumns()
+ sObjects = oFields.ElementNames()
+ Select Case True
+ Case IsMissing(pvIndex)
+ Set oObject = New Collect
+ oObject._CollType = COLLFIELDS
+ oObject._ParentType = _Type
+ oObject._ParentName = _Name
+ oObject._Count = UBound(sObjects) + 1
+ Goto Exit_Function
+ Case VarType(pvIndex) = vbString
+ bFound = False
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ For i = 0 To UBound(sObjects)
+ If UCase(pvIndex) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+ Case Else &apos; pvIndex is numeric
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(sObjects) Then Goto Trace_IndexError
+ sObjectName = sObjects(pvIndex)
+ End Select
+
+ Set oObject = New Field
+ oObject._Name = sObjectName
+ Set oObject.Column = oFields.getByName(sObjectName)
+ oObject._ParentName = _Name
+ oObject._ParentType = _Type
+
+Exit_Function:
+ Set Fields = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Field&quot;, pvIndex))
+ Goto Exit_Function
+Trace_IndexError:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Fields
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.getProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.hasProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenRecordset(ByVal Optional pvType As Variant, ByVal Optional pvOptions As Variant, ByVal Optional pvLockEdit As Variant) As Object
+&apos;Return a Recordset object based on current tabledef object
+
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.OpenRecordset&quot;
+ Utils._SetCalledSub(cstThisSub)
+Const cstNull = -1
+Dim lCommandType As Long, sCommand As String, oObject As Object
+Dim odbDatabase As Object
+ Set oObject = Nothing
+ If IsMissing(pvType) Then
+ pvType = cstNull
+ Else
+ If Not Utils._CheckArgument(pvType, 1, Utils._AddNumeric(), dbOpenForwardOnly) Then Goto Exit_Function
+ End If
+ If IsMissing(pvOptions) Then
+ pvOptions = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOptions, 2, Utils._AddNumeric(), dbSQLPassThrough) Then Goto Exit_Function
+ End If
+ If IsMissing(pvLockEdit) Then
+ pvLockEdit = cstNull
+ Else
+ If Not Utils._CheckArgument(pvLockEdit, 3, Utils._AddNumeric(), dbReadOnly) Then Goto Exit_Function
+ End If
+
+ Select Case _Type
+ Case OBJTABLEDEF
+ lCommandType = com.sun.star.sdb.CommandType.TABLE
+ sCommand = _Name
+ Case OBJQUERYDEF
+ lCommandType = com.sun.star.sdb.CommandType.QUERY
+ sCommand = _Name
+ End Select
+
+ Set oObject = New Recordset
+ With oObject
+ ._CommandType = lCommandType
+ ._Command = sCommand
+ ._ParentName = _Name
+ ._ParentType = _Type
+ ._ForwardOnly = ( pvType = dbOpenForwardOnly )
+ ._PassThrough = ( pvOptions = dbSQLPassThrough )
+ ._ReadOnly = ( pvLockEdit = dbReadOnly )
+ Call ._Initialize()
+ End With
+ Set odbDatabase = Application._CurrentDb()
+ With odbDatabase
+ .RecordsetMax = .RecordsetMax + 1
+ oObject._Name = Format(.RecordsetMax, &quot;0000000&quot;)
+ .RecordsetsColl.Add(oObject, UCase(oObject._Name))
+ End With
+
+ If Not ( oObject._BOF And oObject._EOF ) Then oObject.MoveFirst() &apos; Do nothing if resultset empty
+
+Exit_Function:
+ Set OpenRecordset = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ Set oObject = Nothing
+ GoTo Exit_Function
+End Function &apos; OpenRecordset
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.Properties&quot;
+ Utils._SetCalledSub(cstThisSub)
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; Properties
+
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ Select Case _Type
+ Case OBJTABLEDEF
+ _PropertiesList = Array(&quot;Name&quot;, &quot;ObjectType&quot;)
+ Case OBJQUERYDEF
+ _PropertiesList = Array(&quot;Name&quot;, &quot;ObjectType&quot;, &quot;SQL&quot;, &quot;Type&quot;)
+ Case Else
+ End Select
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type)
+ Utils._SetCalledSub(cstThisSub &amp; &quot;.get&quot; &amp; psProperty)
+Dim vEMPTY As Variant, sSql As String, sVerb As String, iType As Integer
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;SQL&quot;)
+ _PropertyGet = Query.Command
+ Case UCase(&quot;Type&quot;)
+ iType = 0
+ sSql = Trim(UCase(Query.Command))
+ sVerb = Split(sSql, &quot; &quot;)(0)
+ If sVerb = &quot;SELECT&quot; Then iType = iType + dbQSelect
+ If sVerb = &quot;SELECT&quot; And InStr(sSql, &quot; INTO &quot;) &gt; 0 Then iType = iType + dbQMakeTable
+ If sVerb = &quot;SELECT&quot; And InStr(sSql, &quot; UNION &quot;) &gt; 0 Then iType = iType + dbQSetOperation
+ If Not Query.EscapeProcessing Then iType = iType + dbQSQLPassThrough
+ If sVerb = &quot;INSERT&quot; Then iType = iType + dbQAppend
+ If sVerb = &quot;DELETE&quot; Then iType = iType + dbQDelete
+ If sVerb = &quot;UPDATE&quot; Then iType = iType + dbQUpdate
+ If sVerb = &quot;CREATE&quot; _
+ Or sVerb = &quot;ALTER&quot; _
+ Or sVerb = &quot;DROP&quot; _
+ Or sVerb = &quot;RENAME&quot; _
+ Or sVerb = &quot;TRUNCATE&quot; _
+ Then iType = iType + dbQDDL
+ &apos; dbQAction implied by dbQMakeTable, dbQAppend, dbQDelete and dbQUpdate
+ &apos; To check Type use: If (iType And dbQxxx) &lt;&gt; 0 Then ...
+ _PropertyGet = iType
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub &amp; &quot;.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub &amp; &quot;._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type)
+ Utils._SetCalledSub(cstThisSub &amp; &quot;.set&quot; &amp; psProperty)
+
+&apos;Execute
+Dim iArgNr As Integer
+
+ _PropertySet = True
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;setProperty&quot;) : iArgNr = 3
+ Case UCase(cstThisSub &amp; &quot;.setProperty&quot;) : iArgNr = 2
+ Case UCase(cstThisSub &amp; &quot;.set&quot; &amp; psProperty) : iArgNr = 1
+ End Select
+
+ If Not hasProperty(psProperty) Then Goto Trace_Error
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;SQL&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ Query.Command = pvValue
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub &amp; &quot;.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub &amp; &quot;._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set SQL(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;SQL&quot;, pvValue)
+End Property &apos; SQL (set)
+
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba
new file mode 100644
index 000000000000..0eab34147c54
--- /dev/null
+++ b/wizards/source/access2base/Database.xba
@@ -0,0 +1,523 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Database" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be DATABASE
+Private _Standalone As Boolean
+Private Title As String
+Private Document As Object &apos; com.sun.star.comp.dba.ODatabaseDocument or SwXTextDocument
+Private Connection As Object &apos; com.sun.star.sdbc.drivers.OConnectionWrapper
+Private URL As String
+Private MetaData As Object &apos; interface XDatabaseMetaData
+Private Form As Object &apos; com.sun.star.form.XForm
+Private FormName As String &apos; name of standalone form
+Private FindRecord As Object
+Private StatusBar As Object
+Private Dialogs As Object &apos; Collection
+Private RecordsetMax As Integer
+Private RecordsetsColl As Object &apos; Collection of actice recordsets
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJDATABASE
+ _Standalone = False
+ Title = &quot;&quot;
+ Set Document = Nothing
+ Set Connection = Nothing
+ URL = &quot;&quot;
+ Set MetaData = Nothing
+ Set Form = Nothing
+ FormName = &quot;&quot;
+ Set FindRecord = Nothing
+ Set StatusBar = Nothing
+ Set Dialogs = New Collection
+ RecordsetMax = 0
+ Set RecordsetsColl = New Collection
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub CloseAllRecordsets()
+&apos; Clean all recordsets for housekeeping
+
+Dim sRecordsets() As String, i As Integer, oRecordset As Object
+ On Local Error Goto Exit_Sub
+
+ If IsNull(RecordsetsColl) Then Exit Sub
+ If RecordsetsColl.Count &lt; 1 Then Exit Sub
+ For i = 1 To RecordsetsColl.Count
+ Set oRecordset = RecordsetsColl.Item(i)
+ oRecordset.mClose(False) &apos; Do not remove entry in collection
+ Next i
+ Set RecordsetsColl = New Collection
+ RecordsetMax = 0
+
+Exit_Sub:
+ Exit Sub
+End Sub &apos; CloseAllRecordsets V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function CreateQueryDef(ByVal Optional pvQueryName As Variant _
+ , ByVal Optional pvSql As Variant _
+ , ByVal Optional pvOption As Variant _
+ ) As Object
+&apos;Return a (new) QueryDef object based on SQL statement
+Const cstThisSub = &quot;Database.CreateQueryDef&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+Const cstNull = -1
+Dim oQuery As Object, oQueries As Object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Set CreateQueryDef = Nothing
+ If _Standalone() Then Goto Error_Standalone
+ If IsMissing(pvQueryName) Then Call _TraceArguments()
+ If IsMissing(pvSql) Then Call _TraceArguments()
+ If IsMissing(pvOption) Then pvOption = cstNull
+
+ If Not Utils._CheckArgument(pvQueryName, 1, vbString) Then Goto Exit_Function
+ If pvQueryName = &quot;&quot; Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvSql, 2, vbString) Then Goto Exit_Function
+ If pvSql = &quot;&quot; Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvOption, 3, Utils._AddNumeric(), Array(cstNull, dbSQLPassThrough)) Then Goto Exit_Function
+
+ Set oQuery = CreateUnoService(&quot;com.sun.star.sdb.QueryDefinition&quot;)
+ oQuery.rename(pvQueryName)
+ oQuery.Command = Utils._ReplaceSquareBrackets(pvSql)
+ oQuery.EscapeProcessing = Not ( pvOption = dbSQLPassThrough )
+
+ Set oQueries = Document.DataSource.getQueryDefinitions()
+ With oQueries
+ If .hasByName(pvQueryName) Then
+ TraceError(TRACEWARNING, ERRQUERYDEFDELETED, Utils._CalledSub(), 0, False, pvQueryName)
+ .removeByName(pvQueryName)
+ End If
+ .insertByName(pvQueryName, oQuery)
+ End With
+ Set CreateQueryDef = QueryDefs(pvQueryName)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Standalone:
+ TraceError(TRACEFATAL, ERRSTANDALONE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function &apos; CreateQueryDef V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Database.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Database.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenRecordset(ByVal Optional pvSource As Variant _
+ , ByVal Optional pvType As Variant _
+ , ByVal Optional pvOptions As Variant _
+ , ByVal Optional pvLockEdit As Variant _
+ ) As Object
+&apos;Return a Recordset object based on Source (= SQL, table or query name)
+
+Const cstThisSub = &quot;Database.OpenRecordset&quot;
+ Utils._SetCalledSub(cstThisSub)
+Const cstNull = -1
+
+Dim lCommandType As Long, sCommand As String, oObject As Object
+Dim sSource As String, i As Integer, iCount As Integer
+Dim sObjects() As String, bFound As Boolean, oTables As Object, oQueries As Object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Set oObject = Nothing
+ If IsMissing(pvSource) Then Call _TraceArguments()
+ If pvSource = &quot;&quot; Then Call _TraceArguments()
+ If IsMissing(pvType) Then
+ pvType = cstNull
+ Else
+ If Not Utils._CheckArgument(pvType, 1, Utils._AddNumeric(), dbOpenForwardOnly) Then Goto Exit_Function
+ End If
+ If IsMissing(pvOptions) Then
+ pvOptions = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOptions, 2, Utils._AddNumeric(), dbSQLPassThrough) Then Goto Exit_Function
+ End If
+ If IsMissing(pvLockEdit) Then
+ pvLockEdit = cstNull
+ Else
+ If Not Utils._CheckArgument(pvLockEdit, 3, Utils._AddNumeric(), dbReadOnly) Then Goto Exit_Function
+ End If
+
+ sSource = Split(UCase(Trim(pvSource)), &quot; &quot;)(0)
+ Select Case True
+ Case sSource = &quot;SELECT&quot;
+ lCommandType = com.sun.star.sdb.CommandType.COMMAND
+ sCommand = Trim(Utils._ReplaceSquareBrackets(pvSource))
+ Case Else
+ sSource = UCase(Trim(pvSource))
+ REM Explore tables
+ Set oTables = Connection.getTables
+ sObjects = oTables.ElementNames()
+ bFound = False
+ For i = 0 To UBound(sObjects)
+ If sSource = UCase(sObjects(i)) Then
+ sCommand = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then
+ lCommandType = com.sun.star.sdb.CommandType.TABLE
+ Else
+ REM Explore queries
+ Set oQueries = Connection.getQueries
+ sObjects = oQueries.ElementNames()
+ For i = 0 To UBound(sObjects)
+ If sSource = UCase(sObjects(i)) Then
+ sCommand = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+ lCommandType = com.sun.star.sdb.CommandType.QUERY
+ End If
+ End Select
+
+ Set oObject = New Recordset
+ With oObject
+ ._CommandType = lCommandType
+ ._Command = sCommand
+ ._ParentName = Title
+ ._ParentType = _Type
+ ._ForwardOnly = ( pvType = dbOpenForwardOnly )
+ ._PassThrough = ( pvOptions = dbSQLPassThrough )
+ ._ReadOnly = ( pvLockEdit = dbReadOnly )
+ Call ._Initialize()
+ RecordsetMax = RecordsetMax + 1
+ ._Name = Format(RecordsetMax, &quot;0000000&quot;)
+ RecordsetsColl.Add(oObject, UCase(._Name))
+ End With
+
+ If Not ( oObject._BOF And oObject._EOF ) Then oObject.MoveFirst() &apos; Do nothing if resultset empty
+
+Exit_Function:
+ Set OpenRecordset = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Table/Query&quot;, pvSource))
+ Goto Exit_Function
+End Function &apos; OpenRecordset V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+ Utils._SetCalledSub(&quot;Database.Properties&quot;)
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, &quot;&quot;, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, &quot;&quot;, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Utils._ResetCalledSub(&quot;Database.Properties&quot;)
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function QueryDefs(ByVal Optional pvIndex As variant) As Object
+&apos; Collect all Queries in the database
+&apos; Check when standalone &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Database.QueryDefs&quot;)
+
+ Set QueryDefs = Nothing
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+Dim sObjects() As String, sObjectName As String, oObject As Object
+Dim i As Integer, bFound As Boolean, oQueries As Object
+
+ Set oQueries = Connection.getQueries
+ sObjects = oQueries.ElementNames()
+ Select Case True
+ Case IsMissing(pvIndex)
+ Set oObject = New Collect
+ oObject._CollType = COLLQUERYDEFS
+ oObject._ParentType = OBJDATABASE
+ oObject._ParentName = &quot;&quot;
+ oObject._Count = UBound(sObjects) + 1
+ Goto Exit_Function
+ Case VarType(pvIndex) = vbString
+ bFound = False
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ For i = 0 To UBound(sObjects)
+ If UCase(pvIndex) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+ Case Else &apos; pvIndex is numeric
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(sObjects) Then Goto Trace_IndexError
+ sObjectName = sObjects(pvIndex)
+ End Select
+
+ Set oObject = New DataDef
+ oObject._Type = OBJQUERYDEF
+ oObject._Name = sObjectName
+ Set oObject.Query = oQueries.getByName(sObjectName)
+
+Exit_Function:
+ Set QueryDefs = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(&quot;Database.QueryDefs&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Database.QueryDefs&quot;, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Query&quot;, pvIndex))
+ Goto Exit_Function
+Trace_IndexError:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; QueryDefs V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Recordsets(ByVal Optional pvIndex As variant) As Object
+&apos; Collect all active recordsets
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Database.Recordsets&quot;)
+
+ Set Recordsets = Nothing
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+Dim sObjects() As String, sObjectName As String, oObject As Object
+Dim i As Integer, bFound As Boolean, oTables As Object
+
+ Select Case True
+ Case IsMissing(pvIndex)
+ Set oObject = New Collect
+ oObject._CollType = COLLRECORDSETS
+ oObject._ParentType = OBJDATABASE
+ oObject._ParentName = &quot;&quot;
+ oObject._Count = RecordsetsColl.Count
+ Case VarType(pvIndex) = vbString
+ bFound = _hasRecordset(pvIndex)
+ If Not bFound Then Goto Trace_NotFound
+ Set oObject = RecordsetsColl.Item(pvIndex)
+ Case Else &apos; pvIndex is numeric
+ If pvIndex &lt; 0 Or pvIndex &gt;= RecordsetsColl.Count Then Goto Trace_IndexError
+ Set oObject = RecordsetsColl.Item(pvIndex + 1) &apos; Collection members are numbered 1 ... Count
+ End Select
+
+Exit_Function:
+ Set Recordsets = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(&quot;Database.Recordsets&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Database.Recordsets&quot;, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Recordset&quot;, pvIndex))
+ Goto Exit_Function
+Trace_IndexError:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Recordsets V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function TableDefs(ByVal Optional pvIndex As variant) As Object
+&apos; Collect all tables in the database
+&apos; Check when standalone &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Database.TableDefs&quot;)
+
+ Set TableDefs = Nothing
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+Dim sObjects() As String, sObjectName As String, oObject As Object
+Dim i As Integer, bFound As Boolean, oTables As Object
+
+ Set oTables = Connection.getTables
+ sObjects = oTables.ElementNames()
+ Select Case True
+ Case IsMissing(pvIndex)
+ Set oObject = New Collect
+ oObject._CollType = COLLTABLEDEFS
+ oObject._ParentType = OBJDATABASE
+ oObject._ParentName = &quot;&quot;
+ oObject._Count = UBound(sObjects) + 1
+ Goto Exit_Function
+ Case VarType(pvIndex) = vbString
+ bFound = False
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ For i = 0 To UBound(sObjects)
+ If UCase(pvIndex) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+ Case Else &apos; pvIndex is numeric
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(sObjects) Then Goto Trace_IndexError
+ sObjectName = sObjects(pvIndex)
+ End Select
+
+ Set oObject = New DataDef
+ oObject._Type = OBJTABLEDEF
+ oObject._Name = sObjectName
+ Set oObject.Table = oTables.getByName(sObjectName)
+
+Exit_Function:
+ Set TableDefs = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(&quot;Database.TableDefs&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Database.TableDefs&quot;, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Table&quot;, pvIndex))
+ Goto Exit_Function
+Trace_IndexError:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; TableDefs V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _hasDialog(ByVal psName As String) As Boolean
+&apos; Return True if psName if in the collection of started dialogs
+
+Dim oDialog As Object
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Set oDialog = Dialogs.Item(UCase(psName))
+ _hasDialog = True
+
+Exit_Function:
+ Exit Function
+Error_Function: &apos; Item by key aborted
+ _hasDialog = False
+ GoTo Exit_Function
+End Function &apos; _hasDialog V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _hasRecordset(ByVal psName As String) As Boolean
+&apos; Return True if psName if in the collection of Recordsets
+
+Dim oRecordset As Object
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Set oRecordset = RecordsetsColl.Item(psName)
+ _hasRecordset = True
+
+Exit_Function:
+ Exit Function
+Error_Function: &apos; Item by key aborted
+ _hasRecordset = False
+ GoTo Exit_Function
+End Function &apos; _hasRecordset V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ _PropertiesList = Array(&quot;ObjectType&quot;)
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Database.get&quot; &amp; psProperty)
+Dim vEMPTY As Variant
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Database.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Database._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Dialog.xba b/wizards/source/access2base/Dialog.xba
new file mode 100644
index 000000000000..befa7d18d483
--- /dev/null
+++ b/wizards/source/access2base/Dialog.xba
@@ -0,0 +1,667 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Dialog" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be FORM
+Private _Name As String
+Private _Shortcut As String
+Private _Dialog As Object &apos; com.sun.star.io.XInputStreamProvider
+Private UnoDialog As Object &apos; com.sun.star.awt.XControl
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJDIALOG
+ _Name = &quot;&quot;
+ Set _Dialog = Nothing
+ Set UnoDialog = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Caption() As Variant
+ Caption = _PropertyGet(&quot;Caption&quot;)
+End Property &apos; Caption (get)
+
+Property Let Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Height() As Variant
+ Height = _PropertyGet(&quot;Height&quot;)
+End Property &apos; Height (get)
+
+Property Let Height(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Height&quot;, pvValue)
+End Property &apos; Height (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get IsLoaded() As Boolean
+ IsLoaded = _PropertyGet(&quot;IsLoaded&quot;)
+End Property
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OptionGroup(ByVal Optional pvGroupName As Variant) As Variant
+&apos; Return either an error or an object of type OPTIONGROUP based on its name
+&apos; A group is determined by the successive TabIndexes of the radio button
+&apos; The name of the group = the name of its first element
+
+ Utils._SetCalledSub(&quot;Dialog.OptionGroup&quot;)
+ If IsMissing(pvGroupName) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Set OptionGroup = Nothing
+ If Not Utils._CheckArgument(pvGroupName, 1, vbString) Then Goto Exit_Function
+
+Dim iAllCount As Integer, iRadioLast As Integer, iGroupCount As Integer, iBegin As Integer, iEnd As Integer
+Dim oRadios() As Object, sGroupName As String
+Dim i As Integer, j As Integer, bFound As Boolean, ocControl As Object, oRadio As Object, iTabIndex As Integer
+Dim ogGroup As Object, vGroup() As Variant, vIndex() As Variant
+ iAllCount = Controls.Count
+ If iAllCount &gt; 0 Then
+ iRadioLast = -1
+ ReDim oRadios(0 To iAllCount - 1)
+ For i = 0 To iAllCount - 1 &apos; Store all RadioButtons objects
+ Set ocControl = Controls(i)
+ If ocControl._SubType = CTLRADIOBUTTON Then
+ iRadioLast = iRadioLast + 1
+ Set oRadios(iRadioLast) = ocControl
+ End If
+ Next i
+ Else
+ Goto Error_Arg &apos; No control in dialog
+ End If
+
+ If iRadioLast &lt; 0 then Goto Error_Arg &apos; No radio buttons in the dialog
+
+ &apos;Resort oRadio array based on tab indexes
+ If iRadioLast &gt; 0 Then
+ For i = 0 To iRadioLast - 1 &apos; Bubble sort
+ For j = i + 1 To iRadioLast
+ If oRadios(i).TabIndex &gt; oRadios(j).TabIndex Then
+ Set oRadio = oRadios(i)
+ Set oRadios(i) = oRadios(j)
+ Set oRadios(j) = oRadio
+ End If
+ Next j
+ Next i
+ End If
+
+ &apos;Scan Names to find match with argument
+ bFound = False
+ For i = 0 To iRadioLast
+ If UCase(oRadios(i)._Name) = UCase(pvGroupName) Then
+ Select Case i
+ Case 0 : bFound = True
+ Case Else
+ If oRadios(i).TabIndex &gt; oRadios(i - 1).TabIndex + 1 Then
+ bFound = True
+ Else
+ Goto Error_Arg &apos; same group as preceeding item although name correct
+ End If
+ End Select
+ If bFound Then
+ iBegin = i
+ iEnd = i
+ sGroupName = oRadios(i)._Name
+ End If
+ ElseIf bFound Then
+ If oRadios(i).TabIndex = oRadios(i - 1).TabIndex + 1 Then iEnd = i
+ End If
+ Next i
+
+ If bFound Then &apos; Create OptionGroup
+ iGroupCount = iEnd - iBegin + 1
+ Set ogGroup = New OptionGroup
+ ReDim vGroup(0 To iGroupCount - 1)
+ ReDim vIndex(0 To iGroupCount - 1)
+ With ogGroup
+ ._Name = sGroupName
+ ._Count = iGroupCount
+ ._ButtonsGroup = vGroup
+ ._ButtonsIndex = vIndex
+ For i = 0 To iGroupCount - 1
+ Set ._ButtonsGroup(i) = oRadios(iBegin + i).ControlModel
+ ._ButtonsIndex(i) = i
+ Next i
+ ._ParentType = CTLPARENTISDIALOG
+ ._ParentComponent = UnoDialog
+ End With
+ Else Goto Error_Arg
+ End If
+
+ Set OptionGroup = ogGroup
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.OptionGroup&quot;)
+ Exit Function
+Error_Arg:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(1, pvGroupName))
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.OptionGroup&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OptionGroup V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Page() As Variant
+ Page = _PropertyGet(&quot;Page&quot;)
+End Property &apos; Page (get)
+
+Property Let Page(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Page&quot;, pvValue)
+End Property &apos; Page (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Visible() As Variant
+ Visible = _PropertyGet(&quot;Visible&quot;)
+End Property &apos; Visible (get)
+
+Property Let Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Width() As Variant
+ Width = _PropertyGet(&quot;Width&quot;)
+End Property &apos; Width (get)
+
+Property Let Width(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Width&quot;, pvValue)
+End Property &apos; Width (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
+&apos; Return a Control object with name or index = pvIndex
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Dialog.Controls&quot;)
+
+Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
+Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
+Dim j As Integer
+
+ Set ocControl = Nothing
+ If Not IsLoaded Then Goto Trace_Error_NotOpen
+ Set ocControl = New Control
+ ocControl._ParentType = CTLPARENTISDIALOG
+ sParentShortcut = _Shortcut
+ sControls() = UnoDialog.Model.getElementNames()
+ iControlCount = UBound(sControls) + 1
+
+ If IsMissing(pvIndex) Then &apos; No argument, return Collection object
+ Set oCounter = New Collect
+ oCounter._CollType = COLLCONTROLS
+ oCounter._Count = iControlCount
+ Set Controls = oCounter
+ Goto Exit_Function
+ End If
+
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+
+ &apos; Start building the ocControl object
+ &apos; Determine exact name
+
+ Select Case VarType(pvIndex)
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
+ ocControl._Name = sControls(pvIndex)
+ Case vbString &apos; Check control name validity (non case sensitive)
+ bFound = False
+ sIndex = UCase(Utils._Trim(pvIndex))
+ For i = 0 To iControlCount - 1
+ If UCase(sControls(i)) = sIndex Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
+ End Select
+
+ ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
+ Set ocControl.ControlModel = UnoDialog.Model.getByName(ocControl._Name)
+ Set ocControl.ControlView = UnoDialog.getControl(ocControl._Name)
+ ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
+ ocControl._FormComponent = UnoDialog
+
+ ocControl._Initialize()
+ Set Controls = ocControl
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.Controls&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , iArg)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_NotOpen:
+ TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, , _Name)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, pvIndex))
+ Set Controls = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.Controls&quot;, Erl)
+ Set Controls = Nothing
+ GoTo Exit_Function
+End Function &apos; Controls
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub EndExecute(ByVal Optional pvReturn As Variant)
+&apos; Stop executing the dialog
+
+If _ErrorHandler() Then On Local Error Goto Error_Sub
+ Utils._SetCalledSub(&quot;Dialog.endExecute&quot;)
+
+ If IsMissing(pvReturn) Then pvReturn = 0
+ If Not Utils._CheckArgument(pvReturn, 1, Utils._AddNumeric(), , False) Then Goto Trace_Error
+
+Dim lExecute As Long
+ lExecute = CLng(pvReturn)
+ If IsNull(_Dialog) Then Goto Error_Execute
+ If IsNull(UnoDialog) Then Goto Error_Not_Started
+ Call UnoDialog.endDialog(lExecute)
+
+Exit_Sub:
+ Utils._ResetCalledSub(&quot;Dialog.endExecute&quot;)
+ Exit Sub
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(&quot;1&quot;, Utils._CStr(pvReturn)))
+ Goto Exit_Sub
+Error_Execute:
+ TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
+ Goto Exit_Sub
+Error_Not_Started:
+ TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
+ Goto Exit_Sub
+Error_Sub:
+ TraceError(TRACEABORT, Err, &quot;Dialog.endExecute&quot;, Erl)
+ GoTo Exit_Sub
+End Sub &apos; EndExecute
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Execute() As Long
+&apos; Execute dialog
+
+&apos;If _ErrorHandler() Then On Local Error Goto Error_Function
+&apos;Seems smart not to trap errors: debugging of dialog events otherwise made very difficult !
+ Utils._SetCalledSub(&quot;Dialog.Execute&quot;)
+
+Dim lExecute As Long
+ If IsNull(_Dialog) Then Goto Error_Execute
+ If IsNull(UnoDialog) Then Goto Error_Not_Started
+ lExecute = UnoDialog.execute()
+
+ Select Case lExecute
+ Case 1 : Execute = dlgOK
+ Case 0 : Execute = dlgCancel
+ Case Else : Execute = lExecute
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.Execute&quot;)
+ Exit Function
+Error_Execute:
+ TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Not_Started:
+ TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.Execute&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Execute
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Dialog.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Dialog.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Move( ByVal Optional pvLeft As Variant _
+ , ByVal Optional pvTop As Variant _
+ , ByVal Optional pvWidth As Variant _
+ , ByVal Optional pvHeight As Variant _
+ ) As Variant
+&apos; Execute Move method
+ Utils._SetCalledSub(&quot;Dialog.Move&quot;)
+ If IsMissing(pvLeft) Then Call _TraceArguments()
+ On Local Error Goto Error_Function
+ Move = False
+Dim iArgNr As Integer
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;Move&quot;) : iArgNr = 1
+ Case UCase(&quot;Dialog.Move&quot;) : iArgNr = 0
+ End Select
+ If IsMissing(pvLeft) Then Call _TraceArguments()
+ If IsMissing(pvTop) Then pvTop = -1
+ If IsMissing(pvWidth) Then pvWidth = -1
+ If IsMissing(pvHeight) Then pvHeight = -1
+ If Not Utils._CheckArgument(pvLeft, iArgNr + 1, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvTop, iArgNr + 2, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvWidth, iArgNr + 3, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvHeight, iArgNr + 4, Utils._AddNumeric()) Then Goto Exit_Function
+
+Dim iArg As Integer &apos; Check arguments values
+ iArg = 0
+ If pvHeight &lt; -1 Then iArg = 4 : If pvWidth &lt; -1 Then iArg = 3
+ If pvTop &lt; -1 Then iArg = 2 : If pvLeft &lt; -1 Then iArg = 1
+ If iArg &gt; 0 Then
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, iArgNr + iArg)
+ Goto Exit_Function
+ End If
+
+Dim iPosSize As Integer
+ iPosSize = 0
+ If pvLeft &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.X
+ If pvTop &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.Y
+ If pvWidth &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.WIDTH
+ If pvHeight &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.HEIGHT
+ If iPosSize &gt; 0 Then UnoDialog.setPosSize(pvLeft, pvTop, pvWidth, pvHeight, iPosSize)
+ Move = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.Move&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.Move&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Move
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;Dialog.setProperty&quot;)
+ setProperty = _PropertySet(psProperty, pvValue)
+ Utils._ResetCalledSub(&quot;Dialog.setProperty&quot;)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Start() As Boolean
+&apos; Create dialog
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Dialog.Start&quot;)
+
+Dim oStart As Object, oDatabase As Object
+ Start = False
+ If IsNull(_Dialog) Then Goto Error_Start
+ If Not IsNull(UnoDialog) Then Goto Error_Yet_Started
+ Set oStart = CreateUnoDialog(_Dialog)
+ If IsNull(oStart) Then
+ Goto Error_Start
+ Else
+ Start = True
+ Set UnoDialog = oStart
+ Set oDatabase = Application._CurrentDb()
+ With oDatabase
+ If ._hasDialog(_Name) Then .Dialogs.Remove(_Name) &apos; Inserted to solve errors, when aborts between start and terminate
+ .Dialogs.Add(UnoDialog, UCase(_Name))
+ End With
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.Start&quot;)
+ Exit Function
+Error_Start:
+ TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Yet_Started:
+ TraceError(TRACEWARNING, ERRDIALOGSTARTED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.Start&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Start
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Terminate() As Boolean
+&apos; Close dialog
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Dialog.Terminate&quot;)
+
+ Terminate = False
+ If IsNull(_Dialog) Then Goto Error_Terminate
+ If IsNull(UnoDialog) Then Goto Error_Not_Started
+ UnoDialog.Dispose()
+ Set UnoDialog = Nothing
+ Application._CurrentDb().Dialogs.Remove(_Name)
+ Terminate = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.Terminate&quot;)
+ Exit Function
+Error_Terminate:
+ TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Not_Started:
+ TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog.Terminate&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Terminate
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ If IsLoaded Then
+ _PropertiesList = Array(&quot;Caption&quot;, &quot;Height&quot;, &quot;IsLoaded&quot;, &quot;Name&quot; _
+ , &quot;ObjectType&quot;, &quot;Page&quot;, &quot;Visible&quot;, &quot;Width&quot; _
+ )
+ Else
+ _PropertiesList = Array(&quot;IsLoaded&quot;, &quot;Name&quot; _
+ )
+ End If
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Dialog.get&quot; &amp; psProperty)
+
+&apos;Execute
+Dim oDatabase As Object, vEMPTY As Variant
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Name&quot;), UCase(&quot;IsLoaded&quot;)
+ Case Else
+ If IsNull(UnoDialog) Then Goto Trace_Error_Dialog
+ End Select
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Caption&quot;)
+ _PropertyGet = UnoDialog.getTitle()
+ Case UCase(&quot;Height&quot;)
+ _PropertyGet = UnoDialog.getPosSize().Height
+ Case UCase(&quot;IsLoaded&quot;)
+ Set oDatabase = Application._CurrentDb()
+ _PropertyGet = oDatabase._hasDialog(_Name)
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Page&quot;)
+ _PropertyGet = UnoDialog.Model.Step
+ Case UCase(&quot;Visible&quot;)
+ _PropertyGet = UnoDialog.IsVisible()
+ Case UCase(&quot;Width&quot;)
+ _PropertyGet = UnoDialog.getPosSize().Width
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Error_Dialog:
+ TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+
+ Utils._SetCalledSub(&quot;Dialog.set&quot; &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _PropertySet = True
+
+&apos;Execute
+Dim iArgNr As Integer
+Dim oDatabase As Object
+
+ If Len(_A2B_.CalledSub) &gt; 7 And Left(_A2B_.CalledSub, 7) = &quot;Dialog.&quot; Then iArgNr = 1 Else iArgNr = 2
+ If IsNull(UnoDialog) Then Goto Trace_Error_Dialog
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Caption&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ UnoDialog.setTitle(pvValue)
+ Case UCase(&quot;Height&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ UnoDialog.setPosSize(0, 0, 0, pvValue, com.sun.star.awt.PosSize.HEIGHT)
+ Case UCase(&quot;Page&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Then Goto Trace_Error_Value
+ UnoDialog.Model.Step = pvValue
+ Case UCase(&quot;Visible&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ UnoDialog.setVisible(pvValue)
+ Case UCase(&quot;Width&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric()) Then Goto Trace_Error_Value
+ UnoDialog.setPosSize(0, 0, pvValue, 0, com.sun.star.awt.PosSize.WIDTH)
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Dialog.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error_Dialog:
+ TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Dialog._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+Property Set Height(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Height&quot;, pvValue)
+End Property &apos; Height (set)
+
+Property Set Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+Property Set Width(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Width&quot;, pvValue)
+End Property &apos; Width (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/DoCmd.xba b/wizards/source/access2base/DoCmd.xba
new file mode 100644
index 000000000000..1489d4847f49
--- /dev/null
+++ b/wizards/source/access2base/DoCmd.xba
@@ -0,0 +1,2034 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DoCmd" script:language="StarBasic">Option Explicit
+
+Type _FindParams
+ FindRecord As Integer &apos; Set to 1 at first invocation of FindRecord
+ FindWhat As Variant
+ Match As Integer
+ MatchCase As Boolean
+ Search As Integer
+ SearchAsFormatted As Boolean &apos; Must be False
+ FindFirst As Boolean
+ OnlyCurrentField As Integer
+ Form As String &apos; Shortcut
+ GridControl As String &apos; Shortcut
+ Target As String &apos; Shortcut
+ LastRow As Long &apos; Last row explored - 0 = before first
+ LastColumn As Integer &apos; Last column explored - 0 ... N-1 index in next arrays; 0 if OnlyCurrentField = acCurrent
+ ColumnNames() As String &apos; Array of column names in grid with boundfield and of same type as FindWhat
+ ResultSetIndex() As Integer &apos; Array of column numbers in ResultSet
+End Type
+
+&apos;Global _gFind As _FindParams
+
+Type _Window
+ Frame As Object &apos; com.sun.star.comp.framework.Frame
+ _Name As String &apos; Object Name
+ WindowType As Integer &apos; One of the object types
+End Type
+
+REM VBA allows call to actions with missing arguments e.g. OpenForm(&quot;aaa&quot;,,&quot;[field]=2&quot;)
+REM in StarBasic IsMissing requires Variant parameters
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function mClose(Optional ByVal pvObjectType As Variant _
+ , Optional ByVal pvObjectName As Variant _
+ , Optional ByVal pvSave As Variant _
+ ) As Boolean
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;Close&quot;)
+ mClose = False
+ If IsMissing(pvObjectType) Or IsMissing(pvObjectName) Then Call _TraceArguments()
+ If IsMissing(pvSave) Then pvSave = acSavePrompt
+ If Not (Utils._CheckArgument(pvObjectType, 1, Utils._AddNumeric(), _
+ Array(acTable, acQuery, acForm, acReport)) _
+ And Utils._CheckArgument(pvObjectName, 2, vbString) _
+ And Utils._CheckArgument(pvSave, 3, Utils._AddNumeric(), Array(acSavePrompt)) _
+ ) Then Goto Exit_Function
+
+Dim sObjects() As String, sObjectName As String, oController As Object, oObject As Object
+Dim i As Integer, bFound As Boolean, lComponent As Long
+Dim oDatabase As Object
+ If _TraceStandalone() Then Goto Exit_Function
+
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ Set oDatabase = Application._CurrentDb()
+ Select Case pvObjectType
+ Case acForm
+ sObjects = oDatabase.Document.getFormDocuments.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.FORM
+ Case acTable
+ sObjects = oDatabase.Connection.getTables.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.TABLE
+ Case acQuery
+ sObjects = oDatabase.Connection.getQueries.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.QUERY
+ Case acReport
+ sObjects = oDatabase.Document.getReportDocuments.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.REPORT
+ End Select
+ bFound = False
+ For i = 0 To UBound(sObjects)
+ If UCase(pvObjectName) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+
+ Select Case pvObjectType
+ Case acForm
+ Set oController = oDatabase.Document.getFormDocuments.getByName(sObjectName)
+ mClose = oController.close()
+ Case acTable, acQuery &apos; Not optimal but it works !!
+ Set oController = oDatabase.Document.CurrentController
+ Set oObject = oController.loadComponent(lComponent, sObjectName, False)
+ oObject.frame.close(False)
+ mClose = True
+ Case acReport
+ Set oController = oDatabase.Document.getReportDocuments.getByName(sObjectName)
+ mClose = oController.close()
+ End Select
+
+
+Exit_Function:
+ Set oObject = Nothing
+ Set oController = Nothing
+ Utils._ResetCalledSub(&quot;Close&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Close&quot;, Erl)
+ GoTo Exit_Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRCLOSEOBJECT, Utils._CalledSub(), 0, , Array(_GetLabel(Array(&quot;Table&quot;, &quot;Query&quot;, &quot;Form&quot;, &quot;Report&quot;)(pvObjectType)), pvObjectName))
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(_GetLabel(Array(&quot;Table&quot;, &quot;Query&quot;, &quot;Form&quot;, &quot;Report&quot;)(pvObjectType)), pvObjectName))
+ Goto Exit_Function
+End Function &apos; (m)Close
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function FindNext() As Boolean
+&apos; Must be called after a FindRecord
+&apos; Execute instructions set in FindRecord object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ FindNext = False
+ Utils._SetCalledSub(&quot;FindNext&quot;)
+
+Dim ofForm As Object, ocGrid As Object
+Dim i As Integer, lInitialRow As Long, lFindRow As Long
+Dim bFound As Boolean, b2ndRound As Boolean, bStop As Boolean
+Dim vFindValue As Variant, oFindrecord As Object
+
+ oFindRecord = Application.CurrentDb().FindRecord
+ With oFindRecord
+
+ If .FindRecord = 0 Then Goto Error_FindRecord
+ .FindRecord = 0
+ Set ofForm = getObject(.Form)
+ Set ocGrid = getObject(.GridControl)
+
+ &apos; Move cursor to the initial row. Operation based on last FindRecord, not on user interactions done inbetween
+ If ofForm.DatabaseForm.RowCount &lt;= 0 then Goto Exit_Function &apos; Dataset is empty
+
+ lInitialRow = .LastRow &apos; Used if Search = acSearchAll
+
+ bFound = False
+ lFindRow = .LastRow
+ b2ndRound = False
+ Do
+ &apos; Last column ? Go to next row
+ If .LastColumn &gt;= UBound(.ColumnNames) Then
+ bStop = False
+ If ofForm.DatabaseForm.isAfterLast() And .Search = acUp Then
+ ofForm.DatabaseForm.last()
+ ElseIf ofForm.DatabaseForm.isLast() And .Search = acSearchAll Then
+ ofForm.DatabaseForm.first()
+ b2ndRound = True
+ ElseIf ofForm.DatabaseForm.isBeforeFirst() And (.Search = acDown Or .Search = acSearchAll) Then
+ ofForm.DatabaseForm.first()
+ ElseIf ofForm.DatabaseForm.isFirst() And .search = acUp Then
+ ofForm.DatabaseForm.beforeFirst()
+ bStop = True
+ ElseIf ofForm.DatabaseForm.isLast() And .search = acDown Then
+ ofForm.DatabaseForm.afterLast()
+ bStop = True
+ ElseIf .Search = acUp Then
+ ofForm.DatabaseForm.previous()
+ Else
+ ofForm.DatabaseForm.next()
+ End If
+ lFindRow = ofForm.DatabaseForm.getRow()
+ If bStop Or (.Search = acSearchAll And lFindRow &gt;= lInitialRow And b2ndRound) Then
+ ofForm.DatabaseForm.absolute(lInitialRow)
+ Exit Do
+ End If
+ .LastColumn = 0
+ Else
+ .LastColumn = .LastColumn + 1
+ End If
+
+ &apos; Examine column contents
+ If .LastColumn &lt;= UBound(.ColumnNames) Then
+ For i = .LastColumn To UBound(.ColumnNames)
+ vFindValue = Utils._getResultSetColumnValue(ofForm.DatabaseForm.createResultSet(), .ResultSetIndex(i))
+ Select Case VarType(.FindWhat)
+ Case vbDate, vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ bFound = ( .FindWhat = vFindValue )
+ Case vbString
+ Select Case .Match
+ Case acStart
+ If .MatchCase Then
+ bFound = ( Left(.FindWhat, Len(.FindWhat)) = vFindValue )
+ Else
+ bFound = ( UCase(Left(.FindWhat, Len(.FindWhat))) = UCase(vFindValue) )
+ End If
+ Case acAnyWhere
+ If .MatchCase Then
+ bFound = ( InStr(1, vFindValue, .FindWhat, 0) &gt; 0 )
+ Else
+ bFound = ( InStr(vFindValue, .FindWhat) &gt; 0 )
+ End If
+ Case acEntire
+ If .MatchCase Then
+ bFound = ( .FindWhat = vFindValue )
+ Else
+ bFound = ( UCase(.FindWhat) = UCase(vFindValue) )
+ End If
+ End Select
+ End Select
+ If bFound Then
+ .LastColumn = i
+ Exit For
+ End If
+ Next i
+ End If
+ Loop While Not bFound
+
+ .LastRow = lFindRow
+ If bFound Then
+ ocGrid.Controls(.ColumnNames(.LastColumn)).setFocus()
+ .FindRecord = 1
+ FindNext = True
+ End If
+
+ End With
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;FindNext&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;FindNext&quot;, Erl)
+ GoTo Exit_Function
+Error_FindRecord:
+ TraceError(TRACEERRORS, ERRFINDRECORD, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; FindNext V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function FindRecord(Optional ByVal pvFindWhat As Variant _
+ , Optional ByVal pvMatch As Variant _
+ , Optional ByVal pvMatchCase As Variant _
+ , Optional ByVal pvSearch As Variant _
+ , Optional ByVal pvSearchAsFormatted As Variant _
+ , Optional ByVal pvTargetedField As Variant _
+ , Optional ByVal pvFindFirst As Variant _
+ ) As Boolean
+
+&apos;Find a value (string or other) in the underlying data of a gridcontrol
+&apos;Search in all columns or only in one single control
+&apos; see pvTargetedField = acAll or acCurrent
+&apos; pvTargetedField may also be a shortcut to a GridControl or one of its subcontrols
+&apos;Initialize _Findrecord structure in Database root and call FindNext() to set cursor on found value
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ FindRecord = False
+
+ Utils._SetCalledSub(&quot;FindRecord&quot;)
+ If IsMissing(pvFindWhat) Or pvFindWhat = &quot;&quot; Then Call _TraceArguments()
+ If IsMissing(pvMatch) Then pvMatch = acEntire
+ If IsMissing(pvMatchCase) Then pvMatchCase = False
+ If IsMissing(pvSearch) Then pvSearch = acSearchAll
+ If IsMissing(pvSearchAsFormatted) Then pvSearchAsFormatted = False &apos; Anyway only False supported
+ If IsMissing(pvTargetedField) Then pvTargetedField = acCurrent
+ If IsMissing(pvFindFirst) Then pvFindFirst = True
+ If Not (Utils._CheckArgument(pvFindWhat, 1, Utils._AddNumeric(Array(vbString, vbDate))) _
+ And Utils._CheckArgument(pvMatch, 2, Utils._AddNumeric(), Array(acAnywhere, acEntire, acStart)) _
+ And Utils._CheckArgument(pvMatchCase, 3, vbBoolean) _
+ And Utils._CheckArgument(pvSearch, 4, Utils._AddNumeric(), Array(acDown, acSearchAll, acUp)) _
+ And Utils._CheckArgument(pvSearchAsFormatted, 5, vbBoolean, Array(False)) _
+ And Utils._CheckArgument(pvTargetedField, 6, Utils._AddNumeric(vbString)) _
+ And Utils._CheckArgument(pvFindFirst, 7, vbBoolean) _
+ ) Then Exit Function
+ If VarType(pvTargetedField) &lt;&gt; vbString Then
+ If Not Utils._CheckArgument(pvTargetedField, 6, Utils._AddNumeric(), Array(acAll, acCurrent)) Then Exit Function
+ End If
+
+Dim ocTarget As Object, i As Integer, j As Integer, vNames() As Variant, iCount As Integer, vIndexes() As Variant
+Dim vColumn As Variant, vDataField As Variant, ofParentForm As Variant, oColumns As Object, vParentGrid As Object
+Dim bFound As Boolean, ocGridControl As Object, iFocus As Integer
+Dim oFindRecord As _FindParams
+ With oFindRecord
+ .FindRecord = 0
+ .FindWhat = pvFindWhat
+ .Match = pvMatch
+ .MatchCase = pvMatchCase
+ .Search = pvSearch
+ .SearchAsFormatted = pvSearchAsFormatted
+ .FindFirst = pvFindFirst
+
+ &apos; Determine target
+ &apos; Either: pvTargetedField = Grid =&gt; search all fields
+ &apos; pvTargetedField = Control in Grid =&gt; search only in that column
+ &apos; pvTargetedField = acAll or acCurrent =&gt; determine focus
+ Select Case True
+
+ Case VarType(pvTargetedField) = vbString
+ Set ocTarget = getObject(pvTargetedField)
+
+ If ocTarget.SubType = CTLGRIDCONTROL Then
+ .OnlyCurrentField = acAll
+ .GridControl = ocTarget._Shortcut
+ .Target = .GridControl
+ ofParentForm = getObject(_getUpperShortcut(ocTarget._Shortcut, ocTarget._Name))
+ If IsNull(ofParentForm.DatabaseForm) Then Goto Error_DatabaseForm
+ Set oColumns = ofParentForm.DatabaseForm.createResultSet().Columns
+ iCount = -1
+ For i = 0 To ocTarget.ControlModel.Count - 1
+ Set vColumn = ocTarget.ControlModel.getByIndex(i)
+ Set vDataField = vColumn.BoundField &apos; examine field type
+ If Not IsNull(vDataField) Then
+ If _CheckColumnType(pvFindWhat, vDataField) Then
+ iCount = iCount + 1
+ ReDim Preserve vNames(0 To iCount)
+ vNames(iCount) = vColumn.Name
+ ReDim Preserve vIndexes(0 To iCount)
+ For j = 0 To oColumns.Count - 1
+ If vDataField.Name = oColumns.ElementNames(j) Then
+ vIndexes(iCount) = j + 1
+ Exit For
+ End If
+ Next j
+ End If
+ End If
+ Next i
+
+ ElseIf ocTarget._Type = OBJCONTROL Then &apos; Control within a grid tbc
+ If IsNull(ocTarget.ControlModel.BoundField) Then Goto Error_Target &apos; Control MUST be bound to a database record or query
+ &apos; BoundField is in ControlModel, thanks PASTIM !
+ .OnlyCurrentField = acCurrent
+ vParentGrid = getObject(_getUpperShortcut(ocTarget._Shortcut, ocTarget._Name))
+ If vParentGrid.SubType &lt;&gt; CTLGRIDCONTROL Then Goto Error_Target
+ .GridControl = vParentGrid._Shortcut
+ ofParentForm = getObject(_getUpperShortcut(vParentGrid._Shortcut, vParentGrid._Name))
+ If IsNull(ofParentForm.DatabaseForm) Then Goto Error_DatabaseForm
+ .Target = ocTarget._Shortcut
+ Set vDataField = ocTarget.ControlModel.BoundField
+ If Not _CheckColumnType(pvFindWhat, vDataField) Then Goto Error_Target
+ ReDim vNames(0), vIndexes(0)
+ vNames(0) = ocTarget._Name
+ Set oColumns = ofParentForm.DatabaseForm.createResultSet().Columns
+ For j = 0 To oColumns.Count - 1
+ If vDataField.Name = oColumns.ElementNames(j) Then
+ vIndexes(0) = j + 1
+ Exit For
+ End If
+ Next j
+ End If
+
+ Case Else &apos; Determine focus
+ iCount = Application.Forms()._Count
+ If iCount = 0 Then Goto Error_ActiveForm
+ bFound = False
+ For i = 0 To iCount - 1 &apos; Determine form having the focus
+ Set ofParentForm = Application.Forms(i)
+ If ofParentForm.Component.CurrentController.Frame.IsActive() Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Error_ActiveForm
+ If IsNull(ofParentForm.DatabaseForm) Then Goto Error_DatabaseForm
+ iCount = ofParentForm.Controls().Count
+ bFound = False
+ For i = 0 To iCount - 1
+ Set ocGridControl = ofParentForm.Controls(i)
+ If ocGridControl.SubType = CTLGRIDCONTROL Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Error_NoGrid
+ .GridControl= ocGridControl._Shortcut
+ iFocus = -1
+ iFocus = ocGridControl.ControlView.getCurrentColumnPosition() &apos; Deprecated but no alternative found !!
+
+ If pvTargetedField = acAll Or iFocus &lt; 0 Or iFocus &gt;= ocGridControl.ControlModel.Count Then &apos; Has a control within the grid the focus ? NO
+ .OnlyCurrentField = acAll
+ Set oColumns = ofParentForm.DatabaseForm.createResultSet().Columns
+ iCount = -1
+ For i = 0 To ocGridControl.ControlModel.Count - 1
+ Set vColumn = ocGridControl.ControlModel.getByIndex(i)
+ Set vDataField = vColumn.BoundField &apos; examine field type
+ If Not IsNull(vDataField) Then
+ If _CheckColumnType(pvFindWhat, vDataField) Then
+ iCount = iCount + 1
+ ReDim Preserve vNames(0 To iCount)
+ vNames(iCount) = vColumn.Name
+ ReDim Preserve vIndexes(0 To iCount)
+ For j = 0 To oColumns.Count - 1
+ If vDataField.Name = oColumns.ElementNames(j) Then
+ vIndexes(iCount) = j + 1
+ Exit For
+ End If
+ Next j
+ End If
+ End If
+ Next i
+
+ Else &apos; Has a control within the grid the focus ? YES
+ .OnlyCurrentField = acCurrent
+ Set vColumn = ocGridControl.ControlModel.getByIndex(iFocus)
+ Set ocTarget = ocGridControl.Controls(vColumn.Name)
+ .Target = ocTarget._Shortcut
+ Set vDataField = ocTarget.ControlModel.BoundField
+ If IsNull(vDataField) Then Goto Error_Target &apos; Control MUST be bound to a database record or query
+ If Not _CheckColumnType(pvFindWhat, vDataField) Then Goto Error_Target
+ ReDim vNames(0), vIndexes(0)
+ vNames(0) = ocTarget._Name
+ Set oColumns = ofParentForm.DatabaseForm.createResultSet().Columns
+ For j = 0 To oColumns.Count - 1
+ If vDataField.Name = oColumns.ElementNames(j) Then
+ vIndexes(0) = j + 1
+ Exit For
+ End If
+ Next j
+ End If
+
+ End Select
+
+ .Form = ofParentForm._Shortcut
+ .LastColumn = UBound(vNames)
+ .ColumnNames = vNames
+ .ResultSetIndex = vIndexes
+ If pvFindFirst Then
+ Select Case pvSearch
+ Case acDown, acSearchAll
+ ofParentForm.DatabaseForm.beforeFirst()
+ .LastRow = 0
+ Case acUp
+ ofParentForm.DatabaseForm.afterLast()
+ .LastRow = ofParentForm.DatabaseForm.RowCount + 1
+ End Select
+ Else
+ Select Case True
+ Case ofParentForm.DatabaseForm.isBeforeFirst And (pvSearch = acSearchAll Or pvSearch = acDown)
+ .LastRow = 0
+ Case ofParentForm.DatabaseForm.isAfterLast And pvSearch = acUp
+ ofParentForm.DatabaseForm.last() &apos; RowCount produces a wrong value as long as last record has not been reached
+ .LastRow = ofParentForm.DatabaseForm.RowCount + 1
+ Case Else
+ .LastRow = ofParentForm.DatabaseForm.getRow()
+ End Select
+ End If
+
+ .FindRecord = 1
+
+ End With
+ Set Application.CurrentDb().FindRecord = oFindRecord
+ FindRecord = DoCmd.Findnext()
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;FindRecord&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;FindRecord&quot;, Erl)
+ GoTo Exit_Function
+Error_ActiveForm:
+ TraceError(TRACEERRORS, ERRNOACTIVEFORM, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_DatabaseForm:
+ TraceError(TRACEFATAL, ERRDATABASEFORM, Utils._CalledSub(), 0, 1, vParentForm._Name)
+ Goto Exit_Function
+Error_Target:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(6, pvTargetedField))
+ Goto Exit_Function
+Error_NoGrid:
+ TraceError(TRACEFATAL, ERRNOGRIDINFORM, Utils._CalledSub(), 0, 1, vParentForm._Name)
+ Goto Exit_Function
+End Function &apos; FindRecord V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function GoToControl(Optional ByVal pvControlName As variant) As Boolean
+&apos; Set the focus on the named control on the active form.
+&apos; Return False if the control does not exist or is disabled,
+
+ Utils._SetCalledSub(&quot;GoToControl&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ If IsMissing(pvControlName) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvControlName, 1, vbString) Then Goto Exit_Function
+
+ GoToControl = False
+Dim oWindow As Object, ofForm As Object, ocControl As Object
+Dim i As Integer, iCount As Integer
+ Set oWindow = _SelectWindow()
+ If oWindow.WindowType = acForm Then
+ Set ofForm = Application.Forms(oWindow._Name)
+ iCount = ofForm.Controls().Count
+ For i = 0 To iCount - 1
+ ocControl = ofForm.Controls(i)
+ If UCase(ocControl._Name) = UCase(pvControlName) Then
+ If Methods.hasProperty(ocControl, &quot;Enabled&quot;) Then
+ If ocControl.Enabled Then
+ ocControl.setFocus()
+ GoToControl = True
+ Exit For
+ End If
+ End If
+ End If
+ Next i
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;GoToControl&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;GoToControl&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; GoToControl V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function GoToRecord(Optional ByVal pvObjectType As Variant _
+ , Optional ByVal pvObjectName As Variant _
+ , Optional ByVal pvRecord As Variant _
+ , Optional ByVal pvOffset As Variant _
+ ) As Boolean
+
+&apos;Move to record indicated by pvRecord in the object designated by pvObjectType (MUST BE acDataForm)
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ GoToRecord = False
+
+ Utils._SetCalledSub(&quot;GoToRecord&quot;)
+ If IsMissing(pvObjectName) Then pvObjectName = &quot;&quot;
+ If IsMissing(pvObjectType) Then
+ If pvObjectName &lt;&gt; &quot;&quot; Then pvObjectType = acDataForm Else pvObjectType = acActiveDataObject
+ End If
+ If IsMissing(pvRecord) Then pvRecord = acNext
+ If IsMissing(pvOffset) Then pvOffset = 1
+ If Not (Utils._CheckArgument(pvObjectType, 1, Utils._AddNumeric() _
+ , Array(acActiveDataObject, acDataForm)) _
+ And Utils._CheckArgument(pvObjectName, 2, vbString) _
+ And Utils._CheckArgument(pvRecord, 3, Utils._AddNumeric() _
+ , Array(acFirst, acGoTo, acLast, acNewRec, acNext, acPrevious)) _
+ And Utils._CheckArgument(pvOffset, 4, Utils._AddNumeric()) _
+ ) Then Goto Exit_Function
+ If pvObjectType = acActiveDataObject And pvObjectName &lt;&gt; &quot;&quot; Then Goto Error_Target
+ If pvOffset &lt; 0 And pvRecord &lt;&gt; acGoTo Then Goto Error_Offset
+
+Dim ofForm As Object, oGeneric As Object
+Dim i As Integer, iCount As Integer, bFound As Boolean, lOffset As Long
+Dim sObjectName, iLengthName As Integer
+ Select Case pvObjectType
+ Case acActiveDataObject &apos; Determine active form
+ iCount = Application._CountOpenForms()
+ If iCount = 0 Then Goto Error_ActiveForm
+ bFound = False
+ For i = 0 To iCount - 1 &apos; Determine form having the focus
+ Set ofForm = Application.Forms(i)
+ If ofForm.Component.CurrentController.Frame.IsActive() Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Error_ActiveForm
+ Case acDataForm
+ &apos; pvObjectName can be &quot;myForm&quot;, &quot;Forms!myForm&quot;, &quot;Forms!myForm!mySubform&quot; or &quot;Forms!myForm!mySubform.Form&quot;
+ sObjectName = UCase(pvObjectName)
+ iLengthName = Len(sObjectName)
+ Select Case True
+ Case iLengthName &gt; 6 And Left(sObjectName, 6) = &quot;FORMS!&quot; And Right(sObjectName, 5) = &quot;.FORM&quot;
+ Set ofForm = getObject(pvObjectName)
+ If ofForm._Type &lt;&gt; OBJSUBFORM Then Goto Error_Target
+ Case iLengthName &gt; 6 And Left(sObjectName, 6) = &quot;FORMS!&quot;
+ Set oGeneric = getObject(pvObjectName)
+ If oGeneric._Type = OBJFORM Or oGeneric._Type = OBJSUBFORM Then
+ Set ofForm = oGeneric
+ ElseIf oGeneric.SubType = CTLSUBFORM Then
+ Set ofForm = oGeneric.Form
+ Else Goto Error_Target
+ End If
+ Case sObjectName = &quot;&quot;
+ Call _TraceArguments()
+ Case Else
+ Set ofForm = Application.Forms(pvObjectName)
+ End Select
+ Case Else &apos; Not supported
+ End Select
+
+ &apos; Check if current row updated =&gt; Save it
+Dim oResultSet As Object
+ Set oResultSet = ofForm.DatabaseForm
+ If oResultSet.IsNew Then
+ oResultSet.insertRow()
+ ElseIf oResultSet.IsModified Then
+ oResultSet.updateRow()
+ End If
+
+ lOffset = pvOffset
+ Select Case pvRecord
+ Case acFirst : GoToRecord = oResultSet.first()
+ Case acGoTo : GoToRecord = oResultSet.absolute(lOffset)
+ Case acLast : GoToRecord = oResultSet.last()
+ Case acNewRec
+ oResultSet.last() &apos; To simulate the behaviour in the UI
+ oResultSet.moveToInsertRow()
+ GoToRecord = True
+ Case acNext
+ If lOffset = 1 Then
+ GoToRecord = oResultSet.next()
+ Else
+ GoToRecord = oResultSet.relative(lOffset)
+ End If
+ Case acPrevious
+ If lOffset = 1 Then
+ GoToRecord = oResultSet.previous()
+ Else
+ GoToRecord = oResultSet.relative(- lOffset)
+ End If
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;GoToRecord&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;GoToRecord&quot;, Erl)
+ GoTo Exit_Function
+Error_ActiveForm:
+ TraceError(TRACEERRORS, ERRNOACTIVEFORM, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Target:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, 2)
+ Goto Exit_Function
+Error_Offset:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, 4)
+ Goto Exit_Function
+End Function &apos; GoToRecord
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Maximize() As Boolean
+&apos; Maximize the window having the focus
+ Utils._SetCalledSub(&quot;Maximize&quot;)
+
+Dim oWindow As Object
+ Maximize = False
+ Set oWindow = _SelectWindow()
+ If Not IsNull(oWindow.Frame) Then
+ If Utils._hasUNOProperty(oWindow.Frame.ContainerWindow, &quot;IsMaximized&quot;) Then oWindow.Frame.ContainerWindow.IsMaximized = True &apos; Ignored when &lt;= OO3.2
+ Maximize = True
+ End If
+
+ Utils._ResetCalledSub(&quot;Maximize&quot;)
+ Exit Function
+End Function &apos; Maximize V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Minimize() As Boolean
+&apos; Maximize the form having the focus
+ Utils._SetCalledSub(&quot;Minimize&quot;)
+
+Dim oWindow As Object
+ Minimize = False
+ Set oWindow = _SelectWindow()
+ If Not IsNull(oWindow.Frame) Then
+ If Utils._hasUNOProperty(oWindow.Frame.ContainerWindow, &quot;IsMinimized&quot;) Then oWindow.Frame.ContainerWindow.IsMinimized = True
+ Minimize = True
+ End If
+
+ Utils._ResetCalledSub(&quot;Minimize&quot;)
+ Exit Function
+End Function &apos; Minimize V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function MoveSize(ByVal Optional pvRight As Variant _
+ , ByVal Optional pvDown As Variant _
+ , ByVal Optional pvWidth As Variant _
+ , ByVal Optional pvHeight As Variant _
+ ) As Variant
+&apos; Execute MoveSize action
+ Utils._SetCalledSub(&quot;MoveSize&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ MoveSize = False
+ If IsMissing(pvRight) Then pvRight = -1
+ If IsMissing(pvDown) Then pvDown = -1
+ If IsMissing(pvWidth) Then pvWidth = -1
+ If IsMissing(pvHeight) Then pvHeight = -1
+ If Not Utils._CheckArgument(pvRight, 1, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvDown, 2, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvWidth, 3, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvHeight, 4, Utils._AddNumeric()) Then Goto Exit_Function
+
+Dim iArg As Integer &apos; Check argument values
+ iArg = 0
+ If pvHeight &lt; -1 Then iArg = 4 : If pvWidth &lt; -1 Then iArg = 3
+ If pvDown &lt; -1 Then iArg = 2 : If pvRight &lt; -1 Then iArg = 2
+ If iArg &gt; 0 Then
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, iArg)
+ Goto Exit_Function
+ End If
+
+Dim iPosSize As Integer
+ iPosSize = 0
+ If pvRight &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.X
+ If pvDown &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.Y
+ If pvWidth &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.WIDTH
+ If pvHeight &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.HEIGHT
+
+Dim oWindow As Object
+ Set oWindow = _SelectWindow()
+ If Not IsNull(oWindow.Frame) Then
+ oWindow.Frame.ContainerWindow.setPosSize(pvRight, pvDown, pvWidth, pvHeight, iPosSize)
+ MoveSize = True
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;MoveSize&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;MoveSize&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; MoveSize V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenForm(Optional ByVal pvFormName As Variant _
+ , Optional ByVal pvView As Variant _
+ , Optional ByVal pvFilterName As Variant _
+ , Optional ByVal pvWhereCondition As Variant _
+ , Optional ByVal pvDataMode As Variant _
+ , Optional ByVal pvWindowMode As Variant _
+ , Optional ByVal pvOpenArgs As Variant _
+ ) As Variant
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;OpenForm&quot;)
+ If IsMissing(pvFormName) Then Call _TraceArguments()
+ If IsMissing(pvView) Then pvView = acNormal
+ If IsMissing(pvFilterName) Then pvFilterName = &quot;&quot;
+ If IsMissing(pvWhereCondition) Then pvWhereCondition = &quot;&quot;
+ If IsMissing(pvDataMode) Then pvDataMode = acFormPropertySettings
+ If IsMissing(pvWindowMode) Then pvWindowMode = acWindowNormal
+ If IsMissing(pvOpenArgs) Then pvOpenArgs = &quot;&quot;
+ Set OpenForm = Nothing
+ If Not (Utils._CheckArgument(pvFormName, 1, vbString) _
+ And Utils._CheckArgument(pvView, 2, Utils._AddNumeric(), Array(acNormal, acPreview, acDesign)) _
+ And Utils._CheckArgument(pvFilterName, 3, vbString) _
+ And Utils._CheckArgument(pvWhereCondition, 4, vbString) _
+ And Utils._CheckArgument(pvDataMode, 5, Utils._AddNumeric(), Array(acFormAdd, acFormEdit, acFormPropertySettings, acFormReadOnly)) _
+ And Utils._CheckArgument(pvWindowMode, 6, Utils._AddNumeric(), Array(acDialog, acHidden, acIcon, acWindowNormal)) _
+ ) Then Goto Exit_Function
+
+Dim ofForm As Object, sWarning As String
+Dim oOpenForm As Object, bOpenMode As Boolean, oController As Object
+
+ If _TraceStandalone() Then Goto Exit_Function
+
+ Set ofForm = Application.AllForms(pvFormName)
+ If ofForm.IsLoaded Then
+ sWarning = _GetLabel(&quot;ERR&quot; &amp; ERRFORMYETOPEN)
+ sWarning = Join(Split(sWarning, &quot;%0&quot;), ofForm._Name)
+ TraceLog(TRACEANY, &quot;OpenForm: &quot; &amp; sWarning)
+ Set OpenForm = ofForm
+ Goto Exit_Function
+ End If
+&apos; Open the form
+ Select Case pvView
+ Case acNormal, acPreview: bOpenMode = False
+ Case acDesign : bOpenMode = True
+ End Select
+ Set oController = Application._CurrentDb().Document.CurrentController
+ Set oOpenForm = oController.loadComponent(com.sun.star.sdb.application.DatabaseObject.FORM, ofForm._Name, bOpenMode)
+
+&apos; Apply the filters (FilterName) AND (WhereCondition)
+Dim sFilter As String, oForm As Object, oFormsCollection As Object
+ If pvFilterName = &quot;&quot; And pvWhereCondition = &quot;&quot; Then
+ sFilter = &quot;&quot;
+ ElseIf pvFilterName = &quot;&quot; Or pvWhereCondition = &quot;&quot; Then
+ sFilter = pvFilterName &amp; pvWhereCondition
+ Else
+ sFilter = &quot;(&quot; &amp; pvFilterName &amp; &quot;) And (&quot; &amp; pvWhereCondition &amp; &quot;)&quot;
+ End If
+ Set oFormsCollection = oOpenForm.DrawPage.Forms
+ If oFormsCollection.hasByName(&quot;MainForm&quot;) Then
+ Set oForm = oFormsCollection.getByName(&quot;MainForm&quot;)
+ ElseIf oFormsCollection.hasByName(&quot;Form&quot;) Then
+ Set oForm = oFormsCollection.getByName(&quot;Form&quot;)
+ ElseIf oFormsCollection.hasByName(ofForm._Name) Then
+ Set oForm = oFormsCollection.getByName(ofForm._Name)
+ Else
+ Goto Trace_Error
+ End If
+ If sFilter &lt;&gt; &quot;&quot; Then
+ oForm.Filter = Utils._ReplaceSquareBrackets(sFilter)
+ oForm.ApplyFilter = True
+ oForm.reload()
+ ElseIf oForm.Filter &lt;&gt; &quot;&quot; Then &apos; If a filter has been set previously it must be removed
+ oForm.Filter = &quot;&quot;
+ oForm.ApplyFilter = False
+ oForm.reload()
+ End If
+
+&apos;Housekeeping
+ Set ofForm = Application.AllForms(pvFormName) &apos; Redone to reinitialize all properties of ofForm now FormName is open
+ With ofForm
+ Select Case pvDataMode
+ Case acFormAdd
+ .setAllowAdditions = True
+ .AllowDeletions = False
+ .AllowEdits = False
+ Case acFormEdit
+ .AllowAdditions = True
+ .AllowDeletions = True
+ .AllowEdits = True
+ Case acFormReadOnly
+ .AllowAdditions = False
+ .AllowDeletions = False
+ .AllowEdits = False
+ Case acFormPropertySettings
+ End Select
+ .Visible = ( pvWindowMode &lt;&gt; acHidden )
+ ._OpenArgs = pvOpenArgs
+ &apos;To avoid AOO 3,4 bug See http://user.services.openoffice.org/en/forum/viewtopic.php?f=13&amp;t=53751
+ .Component.CurrentController.ViewSettings.ShowOnlineLayout = True
+ End With
+
+ Set OpenForm = ofForm
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OpenForm&quot;)
+ Set ofForm = Nothing
+ Set oOpenForm = Nothing
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenForm&quot;, Erl)
+ Set OpenForm = Nothing
+ GoTo Exit_Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERROPENFORM, Utils._CalledSub(), 0, , pvFormName)
+ Set OpenForm = Nothing
+ Goto Exit_Function
+End Function &apos; OpenForm V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenQuery(Optional ByVal pvQueryName As Variant _
+ , Optional ByVal pvView As Variant _
+ , Optional ByVal pvDataMode As Variant _
+ ) As Boolean
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;OpenQuery&quot;)
+ If IsMissing(pvQueryName) Then Call _TraceArguments()
+ If IsMissing(pvView) Then pvView = acViewNormal
+ If IsMissing(pvDataMode) Then pvDataMode = acEdit
+ OpenQuery = DoCmd._OpenObject(&quot;Query&quot;, pvQueryName, pvView, pvDataMode)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OpenQuery&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenQuery&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OpenQuery
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenReport(Optional ByVal pvReportName As Variant _
+ , Optional ByVal pvView As Variant _
+ , Optional ByVal pvDataMode As Variant _
+ ) As Boolean
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;OpenReport&quot;)
+ If IsMissing(pvReportName) Then Call _TraceArguments()
+ If IsMissing(pvView) Then pvView = acViewNormal
+ If IsMissing(pvDataMode) Then pvDataMode = acEdit
+ OpenReport = DoCmd._OpenObject(&quot;Report&quot;, pvReportName, pvView, pvDataMode)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OpenReport&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenReport&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OpenReport
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenSQL(Optional ByVal pvSQL As Variant _
+ , Optional ByVal pvOption As Variant _
+ ) As Boolean
+&apos; Return True if the execution of the SQL statement was successful
+&apos; SQL must contain a SELECT query
+&apos; pvOption can force pass through mode
+&apos; Derived from BaseTools
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;OpenSQL&quot;)
+
+ OpenSQL = False
+ If IsMissing(pvSQL) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvSQL, 1, vbString) Then Goto Exit_Function
+Const cstNull = -1
+ If IsMissing(pvOption) Then
+ pvOption = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOption, 2, Utils._AddNumeric(), dbSQLPassThrough) Then Goto Exit_Function
+ End If
+
+Dim oDatabase As Object, oURL As New com.sun.star.util.URL, oDispatch As Object
+Dim vArgs(8) as New com.sun.star.beans.PropertyValue
+
+ Set oDatabase = _CurrentDb
+
+ oURL.Complete = &quot;.component:DB/DataSourceBrowser&quot;
+ oDispatch = StarDesktop.queryDispatch(oURL, &quot;_Blank&quot;, 8)
+
+ vArgs(0).Name = &quot;ActiveConnection&quot; : vArgs(0).Value = CurrentDb.Connection
+ vArgs(1).Name = &quot;CommandType&quot; : vArgs(1).Value = com.sun.star.sdb.CommandType.COMMAND
+ vArgs(2).Name = &quot;Command&quot; : vArgs(2).Value = Utils._ReplaceSquareBrackets(pvSQL)
+ vArgs(3).Name = &quot;ShowMenu&quot; : vArgs(3).Value = True
+ vArgs(4).Name = &quot;ShowTreeView&quot; : vArgs(4).Value = False
+ vArgs(5).Name = &quot;ShowTreeViewButton&quot; : vArgs(5).Value = False
+ vArgs(6).Name = &quot;Filter&quot; : vArgs(6).Value = &quot;&quot;
+ vArgs(7).Name = &quot;ApplyFilter&quot; : vArgs(7).Value = False
+ vArgs(8).Name = &quot;EscapeProcessing&quot; : vArgs(8).Value = CBool(Not ( pvOption = dbSQLPassThrough ))
+
+ oDispatch.dispatch(oURL, vArgs)
+ OpenSQL = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OpenSQL&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenSQL&quot;, Erl)
+ GoTo Exit_Function
+SQL_Error:
+ TraceError(TRACEFATAL, ERRSQLSTATEMENT, Utils._CalledSub(), 0, , pvSQL)
+ Goto Exit_Function
+End Function &apos; OpenSQL V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenTable(Optional ByVal pvTableName As Variant _
+ , Optional ByVal pvView As Variant _
+ , Optional ByVal pvDataMode As Variant _
+ ) As Boolean
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;OpenTable&quot;)
+ If IsMissing(pvTableName) Then Call _TraceArguments()
+ If IsMissing(pvView) Then pvView = acViewNormal
+ If IsMissing(pvDataMode) Then pvDataMode = acEdit
+ OpenTable = DoCmd._OpenObject(&quot;Table&quot;, pvTableName, pvView, pvDataMode)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OpenTable&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenTable&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OpenTable
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OutputTo(ByVal pvObjectType As Variant _
+ , ByVal Optional pvObjectName As Variant _
+ , ByVal Optional pvOutputFormat As Variant _
+ , ByVal Optional pvOutputFile As Variant _
+ , ByVal Optional pvAutoStart As Variant _
+ , ByVal Optional pvTemplateFile As Variant _
+ , ByVal Optional pvEncoding As Variant _
+ ) As Boolean
+&apos;Supported: acFormatPDF, acFormatODT, acFormatDOC, acFormatHTML for forms
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;OutputTo&quot;)
+ OutputTo = False
+
+ If Not Utils._CheckArgument(pvObjectType, 1, Utils._AddNumeric(), acSendForm) Then Goto Exit_Function
+ If IsMissing(pvObjectName) Then pvObjectName = &quot;&quot;
+ If Not Utils._CheckArgument(pvObjectName, 2, vbString) Then Goto Exit_Function
+ If IsMissing(pvOutputFormat) Then pvOutputFormat = &quot;&quot;
+ If Not Utils._CheckArgument(pvOutputFormat, 3, vbString) Then Goto Exit_Function
+ If pvOutputFormat &lt;&gt; &quot;&quot; Then
+ If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
+ UCase(acFormatPDF), UCase(acFormatODT), UCase(acFormatDOC), UCase(acFormatHTML) _
+ , &quot;PDF&quot;, &quot;ODT&quot;, &quot;DOC&quot;, &quot;HTML&quot;, &quot;&quot; _
+ )) Then Goto Exit_Function &apos; A 2nd time to allow case unsensitivity
+ End If
+ If IsMissing(pvOutputFile) Then pvOutputFile = &quot;&quot;
+ If Not Utils._CheckArgument(pvOutputFile, 4, vbString) Then Goto Exit_Function
+ If IsMissing(pvAutoStart) Then pvAutoStart = False
+ If Not Utils._CheckArgument(pvAutoStart, 5, vbBoolean) Then Goto Exit_Function
+ If IsMissing(pvTemplateFile) Then pvTemplateFile = &quot;&quot;
+ If Not Utils._CheckArgument(pvTemplateFile, 6, vbString, &quot;&quot;) Then Goto Exit_Function
+ If IsMissing(pvEncoding) Then pvEncoding = &quot;&quot;
+ If Not Utils._CheckArgument(pvEncoding, 7, vbString, &quot;&quot;) Then Goto Exit_Function
+
+Dim vWindow As Variant, sOutputFile As String, ofForm As Object, i As Integer, bFound As Boolean
+ &apos;Find applicable form
+ If pvObjectName = &quot;&quot; Then
+ vWindow = _SelectWindow()
+ If vWindow.WindowType &lt;&gt; acSendForm Then Goto Error_Action
+ Set ofForm = Application.Forms(vWindow._Name)
+ Else
+ bFound = False
+ For i = 0 To Application.Forms()._Count - 1
+ Set ofForm = Application.Forms(i)
+ If UCase(ofForm._Name) = UCase(pvObjectName) Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Error_NotFound
+ End If
+
+ &apos;Determine format and parameters
+Dim sOutputFormat As String, sFilter As String, oFilterData As Object, oExport As Object, sSuffix As String
+ If pvOutputFormat = &quot;&quot; Then
+ sOutputFormat = _PromptFormat() &apos; Prompt user for format
+ If sOutputFormat = &quot;&quot; Then Goto Exit_Function
+ Else
+ sOutputFormat = UCase(pvOutputFormat)
+ End If
+ Select Case sOutputFormat
+ Case UCase(acFormatPDF), &quot;PDF&quot;
+ sFilter = acFormatPDF
+ oFilterData = Array( _
+ _MakePropertyValue (&quot;ExportFormFields&quot;, False), _
+ )
+ sSuffix = &quot;pdf&quot;
+ Case UCase(acFormatDOC), &quot;DOC&quot;
+ sFilter = acFormatDOC
+ oFilterData = Array()
+ sSuffix = &quot;doc&quot;
+ Case UCase(acFormatODT), &quot;ODT&quot;
+ sFilter = acFormatODT
+ oFilterData = Array()
+ sSuffix = &quot;odt&quot;
+ Case UCase(acFormatHTML), &quot;HTML&quot;
+ sFilter = acFormatHTML
+ oFilterData = Array()
+ sSuffix = &quot;html&quot;
+ End Select
+ oExport = Array( _
+ _MakePropertyValue(&quot;Overwrite&quot;, True), _
+ _MakePropertyValue(&quot;FilterName&quot;, sFilter), _
+ _MakePropertyValue(&quot;FilterData&quot;, oFilterData), _
+ )
+
+ &apos;Determine output file
+ If pvOutputFile = &quot;&quot; Then &apos; Prompt file picker to user
+ sOutputFile = _PromptFilePicker(sSuffix)
+ If sOutputFile = &quot;&quot; Then Goto Exit_Function
+ Else
+ sOutputFile = pvOutputFile
+ End If
+ sOutputFile = _ConvertToURL(sOutputFile)
+
+ &apos;Create file
+ On Local Error Goto Error_File
+ ofForm.Component.storeToURL(sOutputFile, oExport)
+ On Local Error Goto Error_Function
+
+ &apos;Launch application, if requested
+ If pvAutoStart Then Call _ShellExecute(sOutputFile)
+
+ OutputTo = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OutputTo&quot;)
+ Exit Function
+Error_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Object&quot;, pvObjectName))
+ Goto Exit_Function
+Error_Action:
+ TraceError(TRACEFATAL, ERRACTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OutputTo&quot;, Erl)
+ GoTo Exit_Function
+Error_File:
+ TraceError(TRACEFATAL, ERRFILENOTCREATED, Utils._CalledSub(), 0, , sOutputFile)
+ GoTo Exit_Function
+End Function &apos; OutputTo V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Quit(Optional ByVal pvSave As Variant) As Variant
+&apos; Quit the application
+&apos; Modified from Andrew Pitonyak&apos;s Base Macro Programming §5.8.1
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Quit&quot;)
+
+ If IsMissing(pvSave) Then pvSave = acQuitSaveAll
+ If Not Utils._CheckArgument(pvSave, 1, Utils._AddNumeric(), _
+ Array(acQuitPrompt, acQuitSaveAll, acQuitSaveNone) _
+ ) Then Goto Exit_Function
+
+Dim vDatabase As Variant, oDoc As Object
+ vDatabase = CurrentDb
+ If Not IsNull(vDatabase) Then
+ Set oDoc = vDatabase.Document
+ Select Case pvSave
+ Case acQuitPrompt
+ If MsgBox(_GetLabel(&quot;QUIT&quot;), _
+ vbYesNo + vbQuestion, _GetLabel(&quot;QUITSHORT&quot;)) = vbNo Then Exit Function
+ Case acQuitSaveNone
+ oDoc.setModified(False)
+ Case Else
+ End Select
+ If HasUnoInterfaces(oDoc, &quot;com.sun.star.util.XCloseable&quot;) Then
+ If (oDoc.isModified) Then
+ If (oDoc.hasLocation AND (Not oDoc.isReadOnly)) Then
+ oDoc.store()
+ End If
+ End If
+ oDoc.close(true)
+ Else
+ oDoc.dispose()
+ End If
+ End If
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Quit&quot;)
+ Set vDatabase = Nothing
+ Set oDoc = Nothing
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Quit&quot;, Erl)
+ Set OpenForm = Nothing
+ GoTo Exit_Function
+End Function &apos; Quit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub RunApp(Optional ByVal pvCommandLine As Variant)
+&apos; Convert to URL and execute the Command Line
+
+ If _ErrorHandler() Then On Local Error Goto Error_Sub
+
+ Utils._SetCalledSub(&quot;RunApp&quot;)
+
+ If IsMissing(pvCommandLine) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvCommandLine, 1, vbString) Then Goto Exit_Sub
+
+ _ShellExecute(_ConvertToURL(pvCommandLine))
+
+Exit_Sub:
+ Utils._ResetCalledSub(&quot;RunApp&quot;)
+ Exit Sub
+Error_Sub:
+ TraceError(TRACEABORT, Err, &quot;RunApp&quot;, Erl)
+ GoTo Exit_Sub
+End Sub &apos; RunApp V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function RunCommand(Optional pvCommand As Variant) As Boolean
+&apos; Execute command via DispatchHelper
+
+ If _ErrorHandler() Then On Local Error Goto Exit_Function &apos; Avoid any abort
+ Utils._SetCalledSub(&quot;RunCommand&quot;)
+
+Dim iVBACommand As Integer, sOOCommand As String, sDispatch As String
+ If IsMissing(pvCommand) Then Call _TraceArguments()
+ If Not ( Utils._CheckArgument(pvCommand, 1, Utils._AddNumeric(vbString)) ) Then Goto Exit_Function
+
+ If VarType(pvCommand) = vbString Then
+ sOOCommand = pvCommand
+ iVBACommand = -1
+ Else
+ sOOCommand = &quot;&quot;
+ iVBACommand = pvCommand
+ End If
+
+ Select Case True
+ Case iVBACommand = acCmdAboutMicrosoftAccess Or UCase(sOOCommand) = &quot;ABOUT&quot; : sDispatch = &quot;About&quot;
+ Case iVBACommand = acCmdAboutOpenOffice Or UCase(sOOCommand) = &quot;ABOUT&quot; : sDispatch = &quot;About&quot;
+ Case iVBACommand = acCmdAboutLibreOffice Or UCase(sOOCommand) = &quot;ABOUT&quot; : sDispatch = &quot;About&quot;
+ Case UCase(sOOCommand) = &quot;ACTIVEHELP&quot; : sDispatch = &quot;ActiveHelp&quot;
+ Case UCase(sOOCommand) = &quot;ADDDIRECT&quot; : sDispatch = &quot;AddDirect&quot;
+ Case UCase(sOOCommand) = &quot;ADDFIELD&quot; : sDispatch = &quot;AddField&quot;
+ Case UCase(sOOCommand) = &quot;AUTOCONTROLFOCUS&quot; : sDispatch = &quot;AutoControlFocus&quot;
+ Case UCase(sOOCommand) = &quot;AUTOFILTER&quot; : sDispatch = &quot;AutoFilter&quot;
+ Case UCase(sOOCommand) = &quot;AUTOPILOTADDRESSDATASOURCE&quot; : sDispatch = &quot;AutoPilotAddressDataSource&quot;
+ Case UCase(sOOCommand) = &quot;BASICBREAK&quot; : sDispatch = &quot;BasicBreak&quot;
+ Case iVBACommand = acCmdVisualBasicEditor Or UCase(sOOCommand) = &quot;BASICIDEAPPEAR&quot; : sDispatch = &quot;BasicIDEAppear&quot;
+ Case UCase(sOOCommand) = &quot;BASICSTOP&quot; : sDispatch = &quot;BasicStop&quot;
+ Case iVBACommand = acCmdBringToFront Or UCase(sOOCommand) = &quot;BRINGTOFRONT&quot; : sDispatch = &quot;BringToFront&quot;
+ Case UCase(sOOCommand) = &quot;CHECKBOX&quot; : sDispatch = &quot;CheckBox&quot;
+ Case UCase(sOOCommand) = &quot;CHOOSEMACRO&quot; : sDispatch = &quot;ChooseMacro&quot;
+ Case iVBACommand = acCmdClose Or UCase(sOOCommand) = &quot;CLOSEDOC&quot; : sDispatch = &quot;CloseDoc&quot;
+ Case UCase(sOOCommand) = &quot;CLOSEWIN&quot; : sDispatch = &quot;CloseWin&quot;
+ Case iVBACommand = acCmdToolbarsCustomize Or UCase(sOOCommand) = &quot;CONFIGUREDIALOG&quot; : sDispatch = &quot;ConfigureDialog&quot;
+ Case UCase(sOOCommand) = &quot;CONTROLPROPERTIES&quot; : sDispatch = &quot;ControlProperties&quot;
+ Case iVBACommand = acCmdChangeToCommandButton Or UCase(sOOCommand) = &quot;CONVERTTOBUTTON&quot; : sDispatch = &quot;ConvertToButton&quot;
+ Case iVBACommand = acCmdChangeToCheckBox Or UCase(sOOCommand) = &quot;CONVERTTOCHECKBOX&quot; : sDispatch = &quot;ConvertToCheckBox&quot;
+ Case iVBACommand = acCmdChangeToComboBox Or UCase(sOOCommand) = &quot;CONVERTTOCOMBO&quot; : sDispatch = &quot;ConvertToCombo&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOCURRENCY&quot; : sDispatch = &quot;ConvertToCurrency&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTODATE&quot; : sDispatch = &quot;ConvertToDate&quot;
+ Case iVBACommand = acCmdChangeToTextBox Or UCase(sOOCommand) = &quot;CONVERTTOEDIT&quot; : sDispatch = &quot;ConvertToEdit&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOFILECONTROL&quot; : sDispatch = &quot;ConvertToFileControl&quot;
+ Case iVBACommand = acCmdChangeToLabel Or UCase(sOOCommand) = &quot;CONVERTTOFIXED&quot; : sDispatch = &quot;ConvertToFixed&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOFORMATTED&quot; : sDispatch = &quot;ConvertToFormatted&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOGROUP&quot; : sDispatch = &quot;ConvertToGroup&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOIMAGEBTN&quot; : sDispatch = &quot;ConvertToImageBtn&quot;
+ Case iVBACommand = acCmdChangeToImage Or UCase(sOOCommand) = &quot;CONVERTTOIMAGECONTROL&quot; : sDispatch = &quot;ConvertToImageControl&quot;
+ Case iVBACommand = acCmdChangeToListBox Or UCase(sOOCommand) = &quot;CONVERTTOLIST&quot; : sDispatch = &quot;ConvertToList&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTONAVIGATIONBAR&quot; : sDispatch = &quot;ConvertToNavigationBar&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTONUMERIC&quot; : sDispatch = &quot;ConvertToNumeric&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOPATTERN&quot; : sDispatch = &quot;ConvertToPattern&quot;
+ Case iVBACommand = acCmdChangeToOptionButton Or UCase(sOOCommand) = &quot;CONVERTTORADIO&quot; : sDispatch = &quot;ConvertToRadio&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOSCROLLBAR&quot; : sDispatch = &quot;ConvertToScrollBar&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOSPINBUTTON&quot; : sDispatch = &quot;ConvertToSpinButton&quot;
+ Case UCase(sOOCommand) = &quot;CONVERTTOTIME&quot; : sDispatch = &quot;ConvertToTime&quot;
+ Case iVBACommand = acCmdCopy Or UCase(sOOCommand) = &quot;COPY&quot; : sDispatch = &quot;Copy&quot;
+ Case UCase(sOOCommand) = &quot;CURRENCYFIELD&quot; : sDispatch = &quot;CurrencyField&quot;
+ Case iVBACommand = acCmdCut Or UCase(sOOCommand) = &quot;CUT&quot; : sDispatch = &quot;Cut&quot;
+ Case UCase(sOOCommand) = &quot;DATEFIELD&quot; : sDispatch = &quot;DateField&quot;
+ Case iVBACommand = acCmdCreateRelationship Or UCase(sOOCommand) = &quot;DBADDRELATION &quot; : sDispatch = &quot;DBAddRelation &quot;
+ Case UCase(sOOCommand) = &quot;DBCONVERTTOVIEW &quot; : sDispatch = &quot;DBConvertToView &quot;
+ Case iVBACommand = acCmdDelete Or UCase(sOOCommand) = &quot;DBDELETE &quot; : sDispatch = &quot;DBDelete &quot;
+ Case UCase(sOOCommand) = &quot;DBDIRECTSQL &quot; : sDispatch = &quot;DBDirectSQL &quot;
+ Case UCase(sOOCommand) = &quot;DBDSADVANCEDSETTINGS &quot; : sDispatch = &quot;DBDSAdvancedSettings &quot;
+ Case UCase(sOOCommand) = &quot;DBDSCONNECTIONTYPE &quot; : sDispatch = &quot;DBDSConnectionType &quot;
+ Case iVBACommand = acCmdDatabaseProperties Or UCase(sOOCommand) = &quot;DBDSPROPERTIES &quot; : sDispatch = &quot;DBDSProperties &quot;
+ Case UCase(sOOCommand) = &quot;DBEDIT &quot; : sDispatch = &quot;DBEdit &quot;
+ Case iVBACommand = acCmdSQLView Or UCase(sOOCommand) = &quot;DBEDITSQLVIEW &quot; : sDispatch = &quot;DBEditSqlView &quot;
+ Case iVBACommand = acCmdRemove Or UCase(sOOCommand) = &quot;DBFORMDELETE &quot; : sDispatch = &quot;DBFormDelete &quot;
+ Case iVBACommand = acCmdDesignView Or UCase(sOOCommand) = &quot;DBFORMEDIT &quot; : sDispatch = &quot;DBFormEdit &quot;
+ Case iVBACommand = acCmdFormView Or UCase(sOOCommand) = &quot;DBFORMOPEN &quot; : sDispatch = &quot;DBFormOpen &quot;
+ Case UCase(sOOCommand) = &quot;DBFORMRENAME &quot; : sDispatch = &quot;DBFormRename &quot;
+ Case iVBACommand = acCmdNewObjectForm Or UCase(sOOCommand) = &quot;DBNEWFORM &quot; : sDispatch = &quot;DBNewForm &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWFORMAUTOPILOT &quot; : sDispatch = &quot;DBNewFormAutoPilot &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWQUERY &quot; : sDispatch = &quot;DBNewQuery &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWQUERYAUTOPILOT &quot; : sDispatch = &quot;DBNewQueryAutoPilot &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWQUERYSQL &quot; : sDispatch = &quot;DBNewQuerySql &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWREPORT &quot; : sDispatch = &quot;DBNewReport &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWREPORTAUTOPILOT &quot; : sDispatch = &quot;DBNewReportAutoPilot &quot;
+ Case iVBACommand = acCmdNewObjectTable Or UCase(sOOCommand) = &quot;DBNEWTABLE &quot; : sDispatch = &quot;DBNewTable &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWTABLEAUTOPILOT &quot; : sDispatch = &quot;DBNewTableAutoPilot &quot;
+ Case iVBACommand = acCmdNewObjectView Or UCase(sOOCommand) = &quot;DBNEWVIEW &quot; : sDispatch = &quot;DBNewView &quot;
+ Case UCase(sOOCommand) = &quot;DBNEWVIEWSQL &quot; : sDispatch = &quot;DBNewViewSQL &quot;
+ Case iVBACommand = acCmdOpenDatabase Or UCase(sOOCommand) = &quot;DBOPEN &quot; : sDispatch = &quot;DBOpen &quot;
+ Case iVBACommand = acCmdRemove Or UCase(sOOCommand) = &quot;DBQUERYDELETE &quot; : sDispatch = &quot;DBQueryDelete &quot;
+ Case iVBACommand = acCmdDesignView Or UCase(sOOCommand) = &quot;DBQUERYEDIT &quot; : sDispatch = &quot;DBQueryEdit &quot;
+ Case iVBACommand = acCmdNewObjectQuery Or UCase(sOOCommand) = &quot;DBQUERYOPEN &quot; : sDispatch = &quot;DBQueryOpen &quot;
+ Case UCase(sOOCommand) = &quot;DBQUERYRENAME &quot; : sDispatch = &quot;DBQueryRename &quot;
+ Case UCase(sOOCommand) = &quot;DBREFRESHTABLES &quot; : sDispatch = &quot;DBRefreshTables &quot;
+ Case iVBACommand = acCmdShowAllRelationships Or UCase(sOOCommand) = &quot;DBRELATIONDESIGN &quot; : sDispatch = &quot;DBRelationDesign &quot;
+ Case UCase(sOOCommand) = &quot;DBRENAME &quot; : sDispatch = &quot;DBRename &quot;
+ Case iVBACommand = acCmdRemove Or UCase(sOOCommand) = &quot;DBREPORTDELETE &quot; : sDispatch = &quot;DBReportDelete &quot;
+ Case iVBACommand = acCmdDesignView Or UCase(sOOCommand) = &quot;DBREPORTEDIT &quot; : sDispatch = &quot;DBReportEdit &quot;
+ Case iVBACommand = acCmdNewObjectReport Or UCase(sOOCommand) = &quot;DBREPORTOPEN &quot; : sDispatch = &quot;DBReportOpen &quot;
+ Case UCase(sOOCommand) = &quot;DBREPORTRENAME &quot; : sDispatch = &quot;DBReportRename &quot;
+ Case iVBACommand = acCmdSelectAll Or UCase(sOOCommand) = &quot;DBSELECTALL &quot; : sDispatch = &quot;DBSelectAll &quot;
+ Case UCase(sOOCommand) = &quot;DBSHOWDOCINFOPREVIEW &quot; : sDispatch = &quot;DBShowDocInfoPreview &quot;
+ Case UCase(sOOCommand) = &quot;DBSHOWDOCPREVIEW &quot; : sDispatch = &quot;DBShowDocPreview &quot;
+ Case iVBACommand = acCmdRemoveTable Or UCase(sOOCommand) = &quot;DBTABLEDELETE &quot; : sDispatch = &quot;DBTableDelete &quot;
+ Case iVBACommand = acCmdDesignView Or UCase(sOOCommand) = &quot;DBTABLEEDIT &quot; : sDispatch = &quot;DBTableEdit &quot;
+ Case UCase(sOOCommand) = &quot;DBTABLEFILTER &quot; : sDispatch = &quot;DBTableFilter &quot;
+ Case iVBACommand = acCmdOpenTable Or UCase(sOOCommand) = &quot;DBTABLEOPEN &quot; : sDispatch = &quot;DBTableOpen &quot;
+ Case iVBACommand = acCmdRename Or UCase(sOOCommand) = &quot;DBTABLERENAME &quot; : sDispatch = &quot;DBTableRename &quot;
+ Case UCase(sOOCommand) = &quot;DBUSERADMIN &quot; : sDispatch = &quot;DBUserAdmin &quot;
+ Case UCase(sOOCommand) = &quot;DBVIEWFORMS &quot; : sDispatch = &quot;DBViewForms &quot;
+ Case UCase(sOOCommand) = &quot;DBVIEWQUERIES &quot; : sDispatch = &quot;DBViewQueries &quot;
+ Case UCase(sOOCommand) = &quot;DBVIEWREPORTS &quot; : sDispatch = &quot;DBViewReports &quot;
+ Case UCase(sOOCommand) = &quot;DBVIEWTABLES &quot; : sDispatch = &quot;DBViewTables &quot;
+ Case iVBACommand = acCmdDelete Or UCase(sOOCommand) = &quot;DELETE&quot; : sDispatch = &quot;Delete&quot;
+ Case iVBACommand = acCmdDeleteRecord Or UCase(sOOCommand) = &quot;DELETERECORD&quot; : sDispatch = &quot;DeleteRecord&quot;
+ Case UCase(sOOCommand) = &quot;DESIGNERDIALOG&quot; : sDispatch = &quot;DesignerDialog&quot;
+ Case UCase(sOOCommand) = &quot;EDIT&quot; : sDispatch = &quot;Edit&quot;
+ Case UCase(sOOCommand) = &quot;FIRSTRECORD&quot; : sDispatch = &quot;FirstRecord&quot;
+ Case UCase(sOOCommand) = &quot;FONTDIALOG&quot; : sDispatch = &quot;FontDialog&quot;
+ Case UCase(sOOCommand) = &quot;FONTHEIGHT&quot; : sDispatch = &quot;FontHeight&quot;
+ Case UCase(sOOCommand) = &quot;FORMATTEDFIELD&quot; : sDispatch = &quot;FormattedField&quot;
+ Case UCase(sOOCommand) = &quot;FORMFILTER&quot; : sDispatch = &quot;FormFilter&quot;
+ Case iVBACommand = acCmdApplyFilterSort Or UCase(sOOCommand) = &quot;FORMFILTERED&quot; : sDispatch = &quot;FormFiltered&quot;
+ Case UCase(sOOCommand) = &quot;FORMFILTEREXECUTE&quot; : sDispatch = &quot;FormFilterExecute&quot;
+ Case UCase(sOOCommand) = &quot;FORMFILTEREXIT&quot; : sDispatch = &quot;FormFilterExit&quot;
+ Case UCase(sOOCommand) = &quot;FORMFILTERNAVIGATOR&quot; : sDispatch = &quot;FormFilterNavigator&quot;
+ Case UCase(sOOCommand) = &quot;FORMPROPERTIES&quot; : sDispatch = &quot;FormProperties&quot;
+ Case UCase(sOOCommand) = &quot;FULLSCREEN&quot; : sDispatch = &quot;FullScreen&quot;
+ Case UCase(sOOCommand) = &quot;GALLERY&quot; : sDispatch = &quot;Gallery&quot;
+ Case UCase(sOOCommand) = &quot;GRID&quot; : sDispatch = &quot;Grid&quot;
+ Case iVBACommand = acCmdSnapToGrid Or UCase(sOOCommand) = &quot;GRIDUSE&quot; : sDispatch = &quot;GridUse&quot;
+ Case iVBACommand = acCmdViewGrid Or UCase(sOOCommand) = &quot;GRIDVISIBLE&quot; : sDispatch = &quot;GridVisible&quot;
+ Case UCase(sOOCommand) = &quot;GROUPBOX&quot; : sDispatch = &quot;GroupBox&quot;
+ Case UCase(sOOCommand) = &quot;HELPINDEX&quot; : sDispatch = &quot;HelpIndex&quot;
+ Case UCase(sOOCommand) = &quot;HELPSUPPORT&quot; : sDispatch = &quot;HelpSupport&quot;
+ Case iVBACommand = acCmdInsertHyperlink Or UCase(sOOCommand) = &quot;HYPERLINKDIALOG&quot; : sDispatch = &quot;HyperlinkDialog&quot;
+ Case UCase(sOOCommand) = &quot;IMAGEBUTTON&quot; : sDispatch = &quot;Imagebutton&quot;
+ Case UCase(sOOCommand) = &quot;IMAGECONTROL&quot; : sDispatch = &quot;ImageControl&quot;
+ Case UCase(sOOCommand) = &quot;LABEL&quot; : sDispatch = &quot;Label&quot;
+ Case iVBACommand = acCmdMaximumRecords Or UCase(sOOCommand) = &quot;LASTRECORD&quot; : sDispatch = &quot;LastRecord&quot;
+ Case UCase(sOOCommand) = &quot;LISTBOX&quot; : sDispatch = &quot;ListBox&quot;
+ Case UCase(sOOCommand) = &quot;MACRODIALOG&quot; : sDispatch = &quot;MacroDialog&quot;
+ Case UCase(sOOCommand) = &quot;MACROORGANIZER&quot; : sDispatch = &quot;MacroOrganizer&quot;
+ Case UCase(sOOCommand) = &quot;MORECONTROLS&quot; : sDispatch = &quot;MoreControls&quot;
+ Case UCase(sOOCommand) = &quot;NAVIGATIONBAR&quot; : sDispatch = &quot;NavigationBar&quot;
+ Case iVBACommand = acCmdObjectBrowser Or UCase(sOOCommand) = &quot;NAVIGATOR&quot; : sDispatch = &quot;Navigator&quot;
+ Case UCase(sOOCommand) = &quot;NEWDOC&quot; : sDispatch = &quot;NewDoc&quot;
+ Case UCase(sOOCommand) = &quot;NEWRECORD&quot; : sDispatch = &quot;NewRecord&quot;
+ Case UCase(sOOCommand) = &quot;NEXTRECORD&quot; : sDispatch = &quot;NextRecord&quot;
+ Case UCase(sOOCommand) = &quot;NUMERICFIELD&quot; : sDispatch = &quot;NumericField&quot;
+ Case UCase(sOOCommand) = &quot;OPEN&quot; : sDispatch = &quot;Open&quot;
+ Case UCase(sOOCommand) = &quot;OPTIONSTREEDIALOG&quot; : sDispatch = &quot;OptionsTreeDialog&quot;
+ Case UCase(sOOCommand) = &quot;ORGANIZER&quot; : sDispatch = &quot;Organizer&quot;
+ Case UCase(sOOCommand) = &quot;PARAGRAPHDIALOG&quot; : sDispatch = &quot;ParagraphDialog&quot;
+ Case iVBACommand = acCmdPaste Or UCase(sOOCommand) = &quot;PASTE&quot; : sDispatch = &quot;Paste&quot;
+ Case iVBACommand = acCmdPasteSpecial Or UCase(sOOCommand) = &quot;PASTESPECIAL &quot; : sDispatch = &quot;PasteSpecial &quot;
+ Case UCase(sOOCommand) = &quot;PATTERNFIELD&quot; : sDispatch = &quot;PatternField&quot;
+ Case UCase(sOOCommand) = &quot;PREVRECORD&quot; : sDispatch = &quot;PrevRecord&quot;
+ Case iVBACommand = acCmdPrint Or UCase(sOOCommand) = &quot;PRINT&quot; : sDispatch = &quot;Print&quot;
+ Case UCase(sOOCommand) = &quot;PRINTDEFAULT&quot; : sDispatch = &quot;PrintDefault&quot;
+ Case UCase(sOOCommand) = &quot;PRINTERSETUP&quot; : sDispatch = &quot;PrinterSetup&quot;
+ Case iVBACommand = acCmdPrintPreview Or UCase(sOOCommand) = &quot;PRINTPREVIEW&quot; : sDispatch = &quot;PrintPreview&quot;
+ Case UCase(sOOCommand) = &quot;PUSHBUTTON&quot; : sDispatch = &quot;Pushbutton&quot;
+ Case UCase(sOOCommand) = &quot;QUIT&quot; : sDispatch = &quot;Quit&quot;
+ Case UCase(sOOCommand) = &quot;RADIOBUTTON&quot; : sDispatch = &quot;RadioButton&quot;
+ Case iVBACommand = acCmdSaveRecord Or UCase(sOOCommand) = &quot;RECSAVE&quot; : sDispatch = &quot;RecSave&quot;
+ Case iVBACommand = acCmdFind Or UCase(sOOCommand) = &quot;RECSEARCH&quot; : sDispatch = &quot;RecSearch&quot;
+ Case iVBACommand = acCmdUndo Or UCase(sOOCommand) = &quot;RECUNDO&quot; : sDispatch = &quot;RecUndo&quot;
+ Case iVBACommand = acCmdRefresh Or UCase(sOOCommand) = &quot;REFRESH&quot; : sDispatch = &quot;Refresh&quot;
+ Case UCase(sOOCommand) = &quot;RELOAD&quot; : sDispatch = &quot;Reload&quot;
+ Case iVBACommand = acCmdRemoveFilterSort Or UCase(sOOCommand) = &quot;REMOVEFILTERSORT&quot; : sDispatch = &quot;RemoveFilterSort&quot;
+ Case iVBACommand = acCmdRunMacro Or UCase(sOOCommand) = &quot;RUNMACRO&quot; : sDispatch = &quot;RunMacro&quot;
+ Case iVBACommand = acCmdSave Or UCase(sOOCommand) = &quot;SAVE&quot; : sDispatch = &quot;Save&quot;
+ Case UCase(sOOCommand) = &quot;SAVEALL&quot; : sDispatch = &quot;SaveAll&quot;
+ Case iVBACommand = acCmdSaveAs Or UCase(sOOCommand) = &quot;SAVEAS&quot; : sDispatch = &quot;SaveAs&quot;
+ Case UCase(sOOCommand) = &quot;SAVEBASICAS&quot; : sDispatch = &quot;SaveBasicAs&quot;
+ Case UCase(sOOCommand) = &quot;SCRIPTORGANIZER&quot; : sDispatch = &quot;ScriptOrganizer&quot;
+ Case UCase(sOOCommand) = &quot;SCROLLBAR&quot; : sDispatch = &quot;ScrollBar&quot;
+ Case iVBACommand = acCmdFind Or UCase(sOOCommand) = &quot;SEARCHDIALOG&quot; : sDispatch = &quot;SearchDialog&quot;
+ Case iVBACommand = acCmdSelectAll Or UCase(sOOCommand) = &quot;SELECTALL&quot; : sDispatch = &quot;SelectAll&quot;
+ Case iVBACommand = acCmdSelectAllRecords Or UCase(sOOCommand) = &quot;SELECTALL&quot; : sDispatch = &quot;SelectAll&quot;
+ Case iVBACommand = acCmdSendToBack Or UCase(sOOCommand) = &quot;SENDTOBACK&quot; : sDispatch = &quot;SendToBack&quot;
+ Case UCase(sOOCommand) = &quot;SHOWFMEXPLORER&quot; : sDispatch = &quot;ShowFmExplorer&quot;
+ Case iVBACommand = acCmdSortDescending Or UCase(sOOCommand) = &quot;SORTDOWN&quot; : sDispatch = &quot;SortDown&quot;
+ Case iVBACommand = acCmdSortAscending Or UCase(sOOCommand) = &quot;SORTUP&quot; : sDispatch = &quot;Sortup&quot;
+ Case UCase(sOOCommand) = &quot;SPINBUTTON&quot; : sDispatch = &quot;SpinButton&quot;
+ Case UCase(sOOCommand) = &quot;STATUSBARVISIBLE&quot; : sDispatch = &quot;StatusBarVisible&quot;
+ Case UCase(sOOCommand) = &quot;SWITCHCONTROLDESIGNMODE&quot; : sDispatch = &quot;SwitchControlDesignMode&quot;
+ Case iVBACommand = acCmdTabOrder Or UCase(sOOCommand) = &quot;TABDIALOG&quot; : sDispatch = &quot;TabDialog&quot;
+ Case UCase(sOOCommand) = &quot;USEWIZARDS&quot; : sDispatch = &quot;UseWizards&quot;
+ Case UCase(sOOCommand) = &quot;VERSIONDIALOG&quot; : sDispatch = &quot;VersionDialog&quot;
+ Case UCase(sOOCommand) = &quot;VIEWDATASOURCEBROWSER&quot; : sDispatch = &quot;ViewDataSourceBrowser&quot;
+ Case iVBACommand = acCmdDatasheetView Or UCase(sOOCommand) = &quot;VIEWFORMASGRID&quot; : sDispatch = &quot;ViewFormAsGrid&quot;
+ Case iVBACommand = acCmdZoomSelection Or UCase(sOOCommand) = &quot;ZOOM&quot; : sDispatch = &quot;Zoom&quot;
+ Case Else
+ If iVBACommand &gt;= 0 Then Goto Exit_Function
+ sDispatch = pvCommand
+ End Select
+
+Dim oDocument As Object, oDispatcher As Object, oArgs() As new com.sun.star.beans.PropertyValue, sTargetFrameName As String
+Dim oResult As Variant
+ oDocument = _SelectWindow().Frame
+ oDispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
+ sTargetFrameName = &quot;&quot;
+ oResult = oDispatcher.executeDispatch(oDocument, &quot;.uno:&quot; &amp; sDispatch, sTargetFrameName, 0, oArgs())
+
+Exit_Function:
+ RunCommand = True
+ Utils._ResetCalledSub(&quot;RunCommand&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;RunCommand&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; RunCommand V0.7.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function RunSQL(Optional ByVal pvSQL As Variant _
+ , Optional ByVal pvOption As Variant _
+ ) As Boolean
+&apos; Return True if the execution of the SQL statement was successful
+&apos; SQL must contain an ACTION query
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Utils._SetCalledSub(&quot;RunSQL&quot;)
+
+ RunSQL = False
+ If IsMissing(pvSQL) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvSQL, 1, vbString) Then Goto Exit_Function
+Const cstNull = -1
+ If IsMissing(pvOption) Then
+ pvOption = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOption, 2, Utils._AddNumeric(), dbSQLPassThrough) Then Goto Exit_Function
+ End If
+
+Dim oDatabase As Object, oStatement As Object, vResult As Variant
+ Set oDatabase = _CurrentDb
+
+ Set oStatement = oDatabase.Connection.createStatement()
+ oStatement.EscapeProcessing = Not ( pvOption = dbSQLPassThrough )
+ On Local Error Goto SQL_Error
+ vResult = oStatement.executeUpdate(Utils._ReplaceSquareBrackets(pvSQL))
+ On Local Error Goto Error_Function
+ RunSQL = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;RunSQL&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;RunSQL&quot;, Erl)
+ GoTo Exit_Function
+SQL_Error:
+ TraceError(TRACEFATAL, ERRSQLSTATEMENT, Utils._CalledSub(), 0, , pvSQL)
+ Goto Exit_Function
+End Function &apos; RunSQL V0.7.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function SelectObject( Optional pvObjectType As Variant _
+ , Optional pvObjectName As Variant _
+ , Optional pvInDatabaseWindow As Variant _
+ ) As Boolean
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;SelectObject&quot;)
+
+ If IsMissing(pvObjectType) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvObjectType, 1, Utils._AddNumeric(), _
+ Array(acDiagram, acForm, acQuery, acTable, acReport, acBasicIDE, acDatabaseWindow) _
+ ) Then Goto Exit_Function
+ If IsMissing(pvObjectName) Then
+ Select Case pvObjectType
+ Case acForm, acQuery, acTable, acReport : Call _TraceArguments()
+ Case Else
+ End Select
+ pvObjectName = &quot;&quot;
+ Else
+ If Not Utils._CheckArgument(pvObjectName, 2, vbString) Then Goto Exit_Function
+ End If
+ If Not IsMissing(pvInDatabaseWindow) Then
+ If Not Utils._CheckArgument(pvInDatabaseWindow, 3, vbBoolean, False) Then Goto Exit_Function
+ End If
+
+Dim oWindow As Object
+ Set oWindow = _SelectWindow(pvObjectType, pvObjectName)
+ If IsNull(oWindow.Frame) Then Goto Error_NotFound
+ oWindow.Frame.ContainerWindow.setFocus()
+ oWindow.Frame.ContainerWindow.setEnable(True) &apos; Added to try to bypass desynchro issue in Linux
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SelectObject&quot;)
+ Exit Function
+Error_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Object&quot;, pvObjectName))
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SelectObject&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; SelectObject V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function SendObject(ByVal Optional pvObjectType As Variant _
+ , ByVal Optional pvObjectName As Variant _
+ , ByVal Optional pvOutputFormat As Variant _
+ , ByVal Optional pvTo As Variant _
+ , ByVal Optional pvCc As Variant _
+ , ByVal Optional pvBcc As Variant _
+ , ByVal Optional pvSubject As Variant _
+ , ByVal Optional pvMessageText As Variant _
+ , ByVal Optional pvEditMessage As Variant _
+ , ByVal Optional pvTemplateFile As Variant _
+ ) As Boolean
+&apos;Supported: acFormatPDF, acFormatODT, acFormatDOC, acFormatHTML for forms
+&apos;To be prepared: acFormatCSV and acFormatODS for tables/queries ?
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;SendObject&quot;)
+ SendObject = False
+
+ If IsMissing(pvObjectType) Then pvObjectType = acSendNoObject
+ If Not Utils._CheckArgument(pvObjectType, 1, Utils._AddNumeric(), Array(acSendNoObject, acSendForm)) Then Goto Exit_Function
+ If IsMissing(pvObjectName) Then pvObjectName = &quot;&quot;
+ If Not Utils._CheckArgument(pvObjectName, 2,vbString) Then Goto Exit_Function
+ If IsMissing(pvOutputFormat) Then pvOutputFormat = &quot;&quot;
+ If Not Utils._CheckArgument(pvOutputFormat, 3, vbString) Then Goto Exit_Function
+ If pvOutputFormat &lt;&gt; &quot;&quot; Then
+ If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
+ UCase(acFormatPDF), UCase(acFormatODT), UCase(acFormatDOC), UCase(acFormatHTML) _
+ , &quot;PDF&quot;, &quot;ODT&quot;, &quot;DOC&quot;, &quot;HTML&quot;, &quot;&quot; _
+ )) Then Goto Exit_Function &apos; A 2nd time to allow case unsensitivity
+ End If
+ If IsMissing(pvTo) Then pvTo = &quot;&quot;
+ If Not Utils._CheckArgument(pvTo, 4, vbString) Then Goto Exit_Function
+ If IsMissing(pvCc) Then pvCc = &quot;&quot;
+ If Not Utils._CheckArgument(pvCc, 5, vbString) Then Goto Exit_Function
+ If IsMissing(pvBcc) Then pvBcc = &quot;&quot;
+ If Not Utils._CheckArgument(pvBcc, 6, vbString) Then Goto Exit_Function
+ If IsMissing(pvSubject) Then pvSubject = &quot;&quot;
+ If Not Utils._CheckArgument(pvSubject, 7, vbString) Then Goto Exit_Function
+ If IsMissing(pvMessageText) Then pvMessageText = &quot;&quot;
+ If Not Utils._CheckArgument(pvMessageText, 8, vbString) Then Goto Exit_Function
+ If IsMissing(pvEditMessage) Then pvEditMessage = True
+ If Not Utils._CheckArgument(pvEditMessage, 9, vbBoolean) Then Goto Exit_Function
+ If IsMissing(pvTemplateFile) Then pvTemplateFile = &quot;&quot;
+ If Not Utils._CheckArgument(pvTemplateFile,10, vbString, &quot;&quot;) Then Goto Exit_Function
+
+Dim vTo() As Variant, vCc() As Variant, vBcc() As Variant, oWindow As Object
+Dim sDirectory As String, sOutputFile As String, sSuffix As String, sOutputFormat As String
+Const cstSemiColon = &quot;;&quot;
+ If pvTo &lt;&gt; &quot;&quot; Then vTo() = Split(pvTo, cstSemiColon) Else vTo() = Array()
+ If pvCc &lt;&gt; &quot;&quot; Then vCc() = Split(pvCc, cstSemiColon) Else vCc() = Array()
+ If pvBcc &lt;&gt; &quot;&quot; Then vBcc() = Split(pvBcc, cstSemiColon) Else vBcc() = Array()
+ Select Case True
+ Case pvObjectType = acSendNoObject And pvObjectName = &quot;&quot;
+ SendObject = _SendWithoutAttachment(vTo, vCc, vBcc, pvSubject, pvMessageText)
+ Case Else
+ If pvObjectType = acSendNoObject And pvObjectName &lt;&gt; &quot;&quot; Then
+ If Not FileExists(pvObjectName) Then Goto Error_File
+ sOutputFile = pvObjectName
+ Else &apos; OutputFile has to be created
+ If pvObjectType &lt;&gt; acSendNoObject And pvObjectName = &quot;&quot; Then
+ oWindow = _SelectWindow()
+ If oWindow.WindowType &lt;&gt; acSendForm Then Goto Error_Action
+ pvObjectType = acSendForm
+ pvObjectName = oWindow._Name
+ End If
+ sDirectory = _getTempDirectoryURL()
+ If Right(sDirectory, 1) &lt;&gt; &quot;/&quot; Then sDirectory = sDirectory &amp; &quot;/&quot;
+ If pvOutputFormat = &quot;&quot; Then
+ sOutputFormat = _PromptFormat() &apos; Prompt user for format
+ If sOutputFormat = &quot;&quot; Then Goto Exit_Function
+ Else
+ sOutputFormat = UCase(pvOutputFormat)
+ End If
+ Select Case sOutputFormat
+ Case UCase(acFormatPDF), &quot;PDF&quot; : sSuffix = &quot;pdf&quot;
+ Case UCase(acFormatDOC), &quot;DOC&quot; : sSuffix = &quot;doc&quot;
+ Case UCase(acFormatODT), &quot;ODT&quot; : sSuffix = &quot;odt&quot;
+ Case UCase(acFormatHTML), &quot;HTML&quot; : sSuffix = &quot;html&quot;
+ End Select
+ sOutputFile = sDirectory &amp; pvObjectName &amp; &quot;.&quot; &amp; sSuffix
+ If Not OutputTo(pvObjectType, pvObjectName, sOutputFormat, sOutputFile, False) Then Goto Exit_Function
+ End If
+ SendObject = _SendWithAttachment(vTo, vCc, vBcc, pvSubject, Array(sOutputFile), pvMessageText, pvEditMessage)
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SendObject&quot;)
+ Exit Function
+Error_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Object&quot;, pvObjectName))
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SendObject&quot;, Erl)
+ GoTo Exit_Function
+Error_Action:
+ TraceError(TRACEFATAL, ERRACTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_File:
+ TraceError(TRACEFATAL, ERRFILEACCESS, Utils._CalledSub(), 0, , pvObjectName)
+ Goto Exit_Function
+End Function &apos; SendObject V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function ShowAllrecords() As Boolean
+&apos; Removes any existing filter that exists on the current table, query or form
+
+ Utils._SetCalledSub(&quot;ShowAllrecords&quot;)
+ ShowAllRecords = False
+Dim oWindow As Object
+ Set oWindow = _SelectWindow()
+ Select Case oWindow.WindowType
+ Case acForm, acQuery, acTable
+ RunCommand(acCmdRemoveFilterSort)
+ ShowAllrecords = True
+ Case Else &apos; Ignore action
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;ShowAllrecords&quot;)
+ Exit Function
+End Function &apos; ShowAllrecords V0.7.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _CheckColumnType(pvFindWhat As Variant, vDataField As Variant) As Boolean
+&apos; Return true if both arguments of the same type
+&apos; vDataField is a ResultSet column
+
+Dim bFound As Boolean
+ bFound = False
+ With com.sun.star.sdbc.DataType
+ Select Case vDataField.Type
+ Case .DATE, .TIME, .TIMESTAMP
+ If VarType(pvFindWhat) = vbDate Then bFound = True
+ Case .TINYINT, .SMALLINT, .INTEGER, .BIGINT, .FLOAT, .REAL, .DOUBLE, .NUMERIC, .DECIMAL
+ If Utils._InList(VarType(pvFindWhat), Utils._AddNumeric()) Then bFound = True
+ Case .CHAR, .VARCHAR, .LONGVARCHAR
+ If VarType(pvFindWhat) = vbString Then bFound = True
+ Case Else
+ End Select
+ End With
+
+ _CheckColumnType = bFound
+
+End Function &apos; _CheckColumnType V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _ConvertToURL(psFile As String) As String
+&apos; Convert psFile to URL only if necessary
+
+Dim bURL As Boolean
+ Select Case True
+ Case Len(psFile &lt; 7) : bURL = False
+ Case LCase(Left(psFile, 7)) = &quot;file://&quot; : bURL = True
+ Case LCase(Left(psFile, 6)) = &quot;ftp://&quot; : bURL = True
+ Case Else : bURL = False
+ End Select
+
+ If bURL Then _ConvertToURL = psFile Else _ConvertToURL = ConvertToURL(psFile)
+
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _getTempDirectoryURL() As String
+&apos; Return the tempry directory defined in the OO Options (Paths)
+Dim sDirectory As String, oSettings As Object, oPathSettings As Object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ _getTempDirectoryURL = &quot;&quot;
+ oPathSettings = createUnoService( &quot;com.sun.star.util.PathSettings&quot; )
+ sDirectory = oPathSettings.GetPropertyValue( &quot;Temp&quot; )
+
+ _getTempDirectoryURL = sDirectory
+
+Exit_Function:
+ Exit Function
+Error_Function:
+ TraceError(&quot;ERROR&quot;, Err, &quot;_getTempDirectoryURL&quot;, Erl)
+ _getTempDirectoryURL = &quot;&quot;
+ Goto Exit_Function
+End Function &apos; _getTempDirectoryURL V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _getUpperShortcut(ByVal psShortcut As String, ByVal psLastComponent As String) As String
+&apos; Return &quot;Forms!myForm&quot; from &quot;Forms!myForm!datField&quot; and &quot;datField&quot;
+
+ If Len(psShortcut) &gt; Len(psLastComponent) Then
+ _getUpperShortcut = Split(psShortcut, &quot;!&quot; &amp; Utils._Surround(psLastComponent))(0)
+ Else
+ _getUpperShortcut = psShortcut
+ End If
+
+End Function &apos; _getUpperShortcut
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _MakePropertyValue(ByVal Optional psName As String, ByVal Optional pvValue As Variant) As com.sun.star.beans.PropertyValue
+&apos;Build PropertyValue(s) array
+
+Dim oPropertyValue As New com.sun.star.beans.PropertyValue
+ If Not IsMissing(psName) Then oPropertyValue.Name = psName
+ If Not IsMissing(pvValue) Then oPropertyValue.Value = pvValue
+ _MakePropertyValue() = oPropertyValue
+End Function &apos; _MakePropertyValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _OpenObject(ByVal psObjectType As String _
+ , ByVal pvObjectName As Variant _
+ , ByVal pvView As Variant _
+ , ByVal pvDataMode As Variant _
+ ) As Boolean
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ _OpenObject = False
+ If Not (Utils._CheckArgument(pvObjectName, 1, vbString) _
+ And Utils._CheckArgument(pvView, 2, Utils._AddNumeric(), Array(acViewNormal, acViewPreview, acViewDesign)) _
+ And Utils._CheckArgument(pvDataMode, 3, Utils._AddNumeric(), Array(acEdit)) _
+ ) Then Goto Exit_Function
+ If _TraceStandalone() Then Goto Exit_Function
+
+Dim sObjects() As String, sObjectName As String, oController As Object, oObject As Object
+Dim i As Integer, bFound As Boolean, lComponent As Long
+Dim oDatabase As Object
+ Set oDatabase = Application._CurrentDb()
+
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ Select Case psObjectType
+ Case &quot;Table&quot;
+ sObjects = oDatabase.Connection.getTables.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.TABLE
+ Case &quot;Query&quot;
+ sObjects = oDatabase.Connection.getQueries.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.QUERY
+ Case &quot;Report&quot;
+ sObjects = oDatabase.Document.getReportDocuments.ElementNames()
+ lComponent = com.sun.star.sdb.application.DatabaseObject.REPORT
+ End Select
+ bFound = False
+ For i = 0 To UBound(sObjects)
+ If UCase(pvObjectName) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+
+ Set oController = oDatabase.Document.CurrentController
+ Set oObject = oController.loadComponent(lComponent, sObjectName, ( pvView = acViewDesign ))
+ _OpenObject = True
+
+Exit_Function:
+ Set oObject = Nothing
+ Set oController = Nothing
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OpenObject&quot;, Erl)
+ GoTo Exit_Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERROPENOBJECT, Utils._CalledSub(), 0, , Array(_GetLabel(psObjectType), pvObjectName))
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(_GetLabel(psObjectType), pvObjectName))
+ Goto Exit_Function
+End Function &apos; _OpenObject V0.8.9
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PromptFormat() As String
+&apos; Return user selection in Format dialog
+
+Dim oDialog As Object, oDialogLib As Object, iOKCancel As Integer, oControl As Object
+ Set oDialogLib = DialogLibraries
+ If Not oDialogLib.IsLibraryLoaded(&quot;Access2Base&quot;) Then oDialogLib.loadLibrary(&quot;Access2Base&quot;)
+ Set oDialog = CreateUnoDialog(DialogLibraries.Access2Base.dlgFormat)
+ oDialog.Title = _GetLabel(&quot;DLGFORMAT_TITLE&quot;)
+
+ Set oControl = oDialog.Model.getByName(&quot;lblFormat&quot;)
+ oControl.Label = _GetLabel(&quot;DLGFORMAT_LBLFORMAT_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGFORMAT_LBLFORMAT_HELP&quot;)
+
+ Set oControl = oDialog.Model.getByName(&quot;cboFormat&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGFORMAT_LBLFORMAT_HELP&quot;)
+
+ Set oControl = oDialog.Model.getByName(&quot;cmdOK&quot;)
+ oControl.Label = _GetLabel(&quot;DLGFORMAT_CMDOK_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGFORMAT_CMDOK_HELP&quot;)
+
+ Set oControl = oDialog.Model.getByName(&quot;cmdCancel&quot;)
+ oControl.Label = _GetLabel(&quot;DLGFORMAT_CMDCANCEL_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGFORMAT_CMDCANCEL_HELP&quot;)
+
+ iOKCancel = oDialog.Execute()
+ Select Case iOKCancel
+ Case 1 &apos; OK
+ _PromptFormat = oDialog.Model.getByName(&quot;cboFormat&quot;).Text
+ Case 0 &apos; Cancel
+ _PromptFormat = &quot;&quot;
+ Case Else
+ End Select
+ oDialog.Dispose()
+
+End Function &apos; _PromptFormat V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _SelectWindow(Optional ByVal piWindowType As Integer, Optional ByVal psWindow As String) As Object
+&apos; No argument: find active window
+&apos; 2 arguments: find corresponding window
+&apos; Return a _Window object type describing the found window
+
+Dim oEnum As Object, oDesk As Object, oComp As Object, oFrame As Object, i As Integer
+Dim bFound As Boolean, bActive As Boolean, bValid As Boolean, sName As String, iType As Integer
+Dim sImplementation As String
+Dim oWindow As _Window
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ bActive = IsMissing(piWindowType)
+ Set oWindow.Frame = Nothing
+ If bActive Then
+ oWindow.WindowType = -1
+ oWindow._Name = &quot;&quot;
+ Else
+ oWindow.WindowType = piWindowType
+ Select Case piWindowType
+ Case acBasicIDE, acDatabaseWindow : oWindow._Name = &quot;&quot;
+ Case Else : oWindow._Name = psWindow
+ End Select
+ End If
+
+
+ Set oDesk = CreateUnoService(&quot;com.sun.star.frame.Desktop&quot;)
+ Set oEnum = oDesk.Components().createEnumeration
+ Do While oEnum.hasMoreElements
+ oComp = oEnum.nextElement
+ If Utils._hasUNOProperty(oComp, &quot;ImplementationName&quot;) Then sImplementation = oComp.ImplementationName Else sImplementation = &quot;&quot;
+ Select Case sImplementation
+ Case &quot;com.sun.star.comp.basic.BasicIDE&quot;
+ Set oFrame = oComp.CurrentController.Frame
+ iType = acBasicIDE
+ sName = &quot;&quot;
+ Case &quot;com.sun.star.comp.dba.ODatabaseDocument&quot;
+ Set oFrame = oComp.CurrentController.Frame
+ iType = acDatabaseWindow
+ sName = &quot;&quot;
+ Case &quot;SwXTextDocument&quot;
+ bValid = True
+ If HasUnoInterfaces(oComp, &quot;com.sun.star.frame.XModule&quot;) Then
+ Select Case oComp.Identifier
+ Case &quot;com.sun.star.sdb.FormDesign&quot; &apos; Form
+ iType = acForm
+ Case &quot;com.sun.star.sdb.TextReportDesign&quot; &apos; Report
+ iType = acReport
+ Case &quot;com.sun.star.text.TextDocument&quot; &apos; Potential standalone form
+ If Not IsNull(CurrentDb(oComp.URL)) Then iType = acForm Else bValid = False
+ Case Else
+ bValid = False &apos; Ignore other Writer documents
+ End Select
+ If bValid Then
+ For i = 0 To UBound(oComp.Args())
+ If oComp.Args(i).Name = &quot;DocumentTitle&quot; Or oComp.Args(i).Name = &quot;Title&quot; Then &apos; Title for standalone forms
+ sName = oComp.Args(i).Value
+ Exit For
+ End If
+ Next i
+ Set oFrame = oComp.CurrentController.Frame
+ End If
+ End If
+ Case &quot;org.openoffice.comp.dbu.ODatasourceBrowser&quot;
+ Set oFrame = oComp.Frame
+ If Not IsEmpty(oComp.Selection) Then &apos; Empty for (F4) DatasourceBrowser !!
+ For i = 0 To UBound(oComp.Selection())
+ If oComp.Selection(i).Name = &quot;Command&quot; Then
+ sName = oComp.Selection(i).Value
+ ElseIf oComp.Selection(i).Name = &quot;CommandType&quot; Then
+ Select Case oComp.selection(i).Value
+ Case com.sun.star.sdb.CommandType.TABLE
+ iType = acTable
+ Case com.sun.star.sdb.CommandType.QUERY
+ iType = acQuery
+ Case com.sun.star.sdb.CommandType.COMMAND
+ iType = acQuery &apos; SQL for future use ?
+ End Select
+ End If
+ Next i
+ &apos; Else ignore
+ End If
+ Case &quot;org.openoffice.comp.dbu.OTableDesign&quot;, &quot;org.openoffice.comp.dbu.OQueryDesign&quot; &apos; Table or Query in Edit mode
+ If Not bActive Then
+ If UCase(Right(oComp.Title, Len(psWindow))) = UCase(psWindow) Then &apos; No rigorous mean found to identify Name
+ Set oFrame = oComp.Frame
+ Select Case sImplementation
+ Case &quot;org.openoffice.comp.dbu.OTableDesign&quot; : iType = acTable
+ Case &quot;org.openoffice.comp.dbu.OQueryDesign&quot; : iType = acQuery
+ End Select
+ sName = Right(oComp.Title, Len(psWindow))
+ End If
+ Else
+ Set oFrame = Nothing
+ End If
+ Case &quot;org.openoffice.comp.dbu.ORelationDesign&quot;
+ Set oFrame = oComp.Frame
+ iType = acDiagram
+ sName = &quot;&quot;
+ Case Else &apos; Ignore other Calc, ..., whatever documents
+ Set oFrame = Nothing
+ End Select
+ If bActive And Not IsNull(oFrame) Then
+ If oFrame.ContainerWindow.IsActive() Then
+ bFound = True
+ Exit Do
+ End If
+ ElseIf iType = piWindowType And UCase(sName) = UCase(psWindow) Then
+ bFound = True
+ Exit Do
+ End If
+ Loop
+
+ If bFound Then
+ Set oWindow.Frame = oFrame
+ oWindow._Name = sName
+ oWindow.WindowType = iType
+ Else
+ Set oWindow.Frame = Nothing
+ End If
+
+Exit_Function:
+ Set _SelectWindow = oWindow
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SelectWindow&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; _SelectWindow V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _SendWithAttachment( _
+ ByVal pvRecipients() As Variant _
+ , ByVal pvCcRecipients() As Variant _
+ , ByVal pvBccRecipients() As Variant _
+ , ByVal psSubject As String _
+ , ByVal pvAttachments() As Variant _
+ , ByVal pvBody As String _
+ , ByVal pbEditMessage As Boolean _
+ ) As Boolean
+
+&apos; Send message with attachments
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _SendWithAttachment = False
+
+Const cstWindows = 1
+Const cstLinux = 4
+Const cstSemiColon = &quot;;&quot;
+Dim oServiceMail as Object, oMail As Object, oMessage As Object, vFlag As Variant
+Dim vCc() As Variant, i As Integer, iOS As Integer, sProduct As String, bMailProvider As Boolean
+
+ &apos;OPENOFFICE &lt;= 3.6 and LIBREOFFICE have XSimple...Mail interface while OPENOFFICE &gt;= 4.0 has XSystemMailProvider interface
+ sProduct = UCase(Utils._GetProductName())
+ bMailProvider = ( Left(sProduct, 4) = &quot;OPEN&quot; And Left(_GetProductName(&quot;VERSION&quot;), 3) &gt;= &quot;4.0&quot; )
+
+ iOS = GetGuiType()
+ Select Case iOS
+ Case cstLinux
+ oServiceMail = createUnoService(&quot;com.sun.star.system.SimpleCommandMail&quot;)
+ Case cstWindows
+ If bMailProvider Then oServiceMail = createUnoService(&quot;com.sun.star.system.SystemMailProvider&quot;) _
+ Else oServiceMail = createUnoService(&quot;com.sun.star.system.SimpleSystemMail&quot;)
+ Case Else
+ Goto Error_Mail
+ End Select
+
+ If bMailProvider Then Set oMail = oServiceMail.queryMailClient() _
+ Else Set oMail = oServiceMail.querySimpleMailClient()
+ If IsNull(oMail) Then Goto Error_Mail
+
+ &apos;Reattribute Recipients &gt;= 2nd to ccRecipients
+ If UBound(pvRecipients) &lt;= 0 Then
+ If UBound(pvCcRecipients) &gt;= 0 Then vCc = pvCcRecipients
+ Else
+ ReDim vCc(0 To UBound(pvRecipients) - 1 + UBound(pvCcRecipients) + 1)
+ For i = 0 To UBound(pvRecipients) - 1
+ vCc(i) = pvRecipients(i + 1)
+ Next i
+ For i = UBound(pvRecipients) To UBound(vCc)
+ vCc(i) = pvCcRecipients(i - UBound(pvRecipients))
+ Next i
+ End If
+
+ If bMailProvider Then
+ Set oMessage = oMail.createMailMessage()
+ If UBound(pvRecipients) &gt;= 0 Then oMessage.Recipient = pvRecipients(0)
+ If psSubject &lt;&gt; &quot;&quot; Then oMessage.Subject = psSubject
+ Select Case iOS &apos; Not published differences between com.sun.star.system.SimpleCommandMail and SimpleSystemMail
+ Case cstLinux
+ If UBound(vCc) &gt;= 0 Then oMessage.CcRecipient = Array(Join(vCc, cstSemiColon))
+ If UBound(pvBccRecipients) &gt;= 0 Then oMessage.BccRecipient = Array(Join(pvBccRecipients, cstSemiColon))
+ Case cstWindows
+ If UBound(vCc) &gt;= 0 Then oMessage.CcRecipient = vCc
+ If UBound(pvBccRecipients) &gt;= 0 Then oMessage.BccRecipient = pvBccRecipients
+ End Select
+ If UBound(pvAttachments) &gt;= 0 Then oMessage.Attachement = pvAttachments
+ If pvBody &lt;&gt; &quot;&quot; Then oMessage.Body = pvBody
+ If pbEditMessage Then
+ vFlag = com.sun.star.system.MailClientFlags.DEFAULTS
+ Else
+ vFlag = com.sun.star.system.MailClientFlags.NO_USER_INTERFACE
+ End If
+ oMail.sendMailMessage(oMessage, vFlag)
+ Else
+ Set oMessage = oMail.createSimpleMailMessage() &apos; Body NOT SUPPORTED !
+ If UBound(pvRecipients) &gt;= 0 Then oMessage.setRecipient(pvRecipients(0))
+ If psSubject &lt;&gt; &quot;&quot; Then oMessage.setSubject(psSubject)
+ Select Case iOS
+ Case cstLinux
+ If UBound(vCc) &gt;= 0 Then oMessage.setCcRecipient(Array(Join(vCc, cstSemiColon)))
+ If UBound(pvBccRecipients) &gt;= 0 Then oMessage.setBccRecipient(Array(Join(pvBccRecipients, cstSemiColon)))
+ Case cstWindows
+ If UBound(vCc) &gt;= 0 Then oMessage.setCcRecipient(vCc)
+ If UBound(pvBccRecipients) &gt;= 0 Then oMessage.setBccRecipient(pvBccRecipients)
+ End Select
+ If UBound(pvAttachments) &gt;= 0 Then oMessage.setAttachement(pvAttachments)
+ If pbEditMessage Then
+ vFlag = com.sun.star.system.SimpleMailClientFlags.DEFAULTS
+ Else
+ vFlag = com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE
+ End If
+ oMail.sendSimpleMailMessage(oMessage, vFlag)
+ End If
+
+ _SendWithAttachment = True
+
+Exit_Function:
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;_SendWithAttachment&quot;, Erl)
+ Goto Exit_Function
+Error_Mail:
+ TraceError(TRACEFATAL, ERRSENDMAIL, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; _SendWithAttachment V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _SendWithoutAttachment(ByVal pvTo As Variant _
+ , ByVal pvCc As Variant _
+ , ByVal pvBcc As Variant _
+ , ByVal psSubject As String _
+ , ByVal psBody As String _
+ ) As Boolean
+&apos;Send simple message with mailto: syntax
+Dim sMailTo As String, sTo As String, sCc As String, sBcc As String, sSubject As String, sBody As String, oDispatch As Object
+Const cstComma = &quot;,&quot;
+Const cstSpace = &quot;%20&quot;
+Const cstCR = &quot;%0A&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If UBound(pvTo) &gt;= 0 Then sTo = Trim(Join(pvTo, cstComma)) Else sTo = &quot;&quot;
+ If UBound(pvCc) &gt;= 0 Then sCc = Trim(Join(pvCc, cstComma)) Else sCc = &quot;&quot;
+ If UBound(pvBcc) &gt;= 0 Then sBcc = Trim(Join(pvBcc, cstComma)) Else sBcc = &quot;&quot;
+ If psSubject &lt;&gt; &quot;&quot; Then sSubject = Join(Split(psSubject, &quot; &quot;), cstSpace) Else sSubject = &quot;&quot;
+ If psBody &lt;&gt; &quot;&quot; Then
+ sBody = Join(Split(psBody, Chr(13)), cstCR)
+ sBody = Join(Split(sBody, &quot; &quot;), cstSpace)
+ End If
+
+ sMailTo = &quot;mailto:&quot; _
+ &amp; sTo &amp; &quot;?&quot; _
+ &amp; Iif(sCc = &quot;&quot;, &quot;&quot;, &quot;cc=&quot; &amp; sCc &amp; &quot;&amp;&quot;) _
+ &amp; Iif(sBcc = &quot;&quot;, &quot;&quot;, &quot;bcc=&quot; &amp; sBcc &amp; &quot;&amp;&quot;) _
+ &amp; Iif(sSubject = &quot;&quot;, &quot;&quot;, &quot;subject=&quot; &amp; sSubject &amp; &quot;&amp;&quot;) _
+ &amp; Iif(sBody = &quot;&quot;, &quot;&quot;, &quot;body=&quot; &amp; sBody &amp; &quot;&amp;&quot;)
+ If Right(sMailTo, 1) = &quot;&amp;&quot; Or Right(sMailTo, 1) = &quot;?&quot; Then sMailTo = Left(sMailTo, Len(sMailTo) - 1)
+
+ oDispatch = createUnoService( &quot;com.sun.star.frame.DispatchHelper&quot;)
+ oDispatch.executeDispatch(StarDesktop, sMailTo, &quot;&quot;, 0, Array())
+
+ _SendWithoutAttachment = True
+
+Exit_Function:
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;_SendWithoutAttachments&quot;, Erl)
+ _SendWithoutAttachment = False
+ Goto Exit_Function
+End Function &apos; _SendWithoutAttachment V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub _ShellExecute(sCommand As String)
+&apos; Execute shell command
+
+Dim oShell As Object
+ Set oShell = createUnoService(&quot;com.sun.star.system.SystemShellExecute&quot;)
+ oShell.execute(sCommand, &quot;&quot; , com.sun.star.system.SystemShellExecuteFlags.DEFAULTS)
+
+End Sub &apos; _ShellExecute V0.8.5
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Event.xba b/wizards/source/access2base/Event.xba
new file mode 100644
index 000000000000..ec2ee2474456
--- /dev/null
+++ b/wizards/source/access2base/Event.xba
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Event" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be EVENT
+Private _EventSource As Object
+Private _EventType As String
+Private _EventName As String
+Private _SubComponentName As String
+Private _SubComponentType As Long
+Private _ContextShortcut As String
+Private _ButtonLeft As Boolean &apos; com.sun.star.awt.MouseButton.XXX
+Private _ButtonRight As Boolean
+Private _ButtonMiddle As Boolean
+Private _XPos As Variant &apos; Null or Long
+Private _YPos As Variant &apos; Null or Long
+Private _ClickCount As Long
+Private _KeyCode As Integer &apos; com.sun.star.awt.Key.XXX
+Private _KeyChar As String
+Private _KeyFunction As Integer &apos; com.sun.star.awt.KeyFunction.XXX
+Private _KeyAlt As Boolean
+Private _KeyCtrl As Boolean
+Private _KeyShift As Boolean
+Private _FocusChangeTemporary As Boolean &apos; False if user action in same window
+Private _RowChangeAction As Long &apos; com.sun.star.sdb.RowChangeAction.XXX
+Private _Recommendation As String &apos; &quot;IGNORE&quot; or &quot;&quot;
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJEVENT
+ _EventSource = Nothing
+ _EventType = &quot;&quot;
+ _EventName = &quot;&quot;
+ _SubComponentName = &quot;&quot;
+ _SubComponentType = -1
+ _ContextShortcut = &quot;&quot;
+ _ButtonLeft = False &apos; See com.sun.star.awt.MouseButton.XXX
+ _ButtonRight = False
+ _ButtonMiddle = False
+ _XPos = Null
+ _YPos = Null
+ _ClickCount = 0
+ _KeyCode = 0
+ _KeyChar = &quot;&quot;
+ _KeyFunction = com.sun.star.awt.KeyFunction.DONTKNOW
+ _KeyAlt = False
+ _KeyCtrl = False
+ _KeyShift = False
+ _FocusChangeTemporary = False
+ _RowChangeAction = 0
+ _Recommendation = &quot;&quot;
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ButtonLeft() As Variant
+ ButtonLeft = _PropertyGet(&quot;ButtonLeft&quot;)
+End Property &apos; ButtonLeft (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ButtonMiddle() As Variant
+ ButtonMiddle = _PropertyGet(&quot;ButtonMiddle&quot;)
+End Property &apos; ButtonMiddle (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ButtonRight() As Variant
+ ButtonRight = _PropertyGet(&quot;ButtonRight&quot;)
+End Property &apos; ButtonRight (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ClickCount() As Variant
+ ClickCount = _PropertyGet(&quot;ClickCount&quot;)
+End Property &apos; ClickCount (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ContextShortcut() As Variant
+ ContextShortcut = _PropertyGet(&quot;ContextShortcut&quot;)
+End Property &apos; ContextShortcut (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get EventName() As Variant
+ EventName = _PropertyGet(&quot;EventName&quot;)
+End Property &apos; EventName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get EventSource() As Variant
+ EventSource = _PropertyGet(&quot;EventSource&quot;)
+End Property &apos; EventSource (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get EventType() As Variant
+ EventType = _PropertyGet(&quot;EventType&quot;)
+End Property &apos; EventType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FocusChangeTemporary() As Variant
+ FocusChangeTemporary = _PropertyGet(&quot;FocusChangeTemporary&quot;)
+End Property &apos; FocusChangeTemporary (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyAlt() As Variant
+ KeyAlt = _PropertyGet(&quot;KeyAlt&quot;)
+End Property &apos; KeyAlt (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyChar() As Variant
+ KeyChar = _PropertyGet(&quot;KeyChar&quot;)
+End Property &apos; KeyChar (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyCode() As Variant
+ KeyCode = _PropertyGet(&quot;KeyCode&quot;)
+End Property &apos; KeyCode (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyCtrl() As Variant
+ KeyCtrl = _PropertyGet(&quot;KeyCtrl&quot;)
+End Property &apos; KeyCtrl (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyFunction() As Variant
+ KeyFunction = _PropertyGet(&quot;KeyFunction&quot;)
+End Property &apos; KeyFunction (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get KeyShift() As Variant
+ KeyShift = _PropertyGet(&quot;KeyShift&quot;)
+End Property &apos; KeyShift (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, &quot;&quot;, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, &quot;&quot;, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Recommendation() As Variant
+ Recommendation = _PropertyGet(&quot;Recommendation&quot;)
+End Property &apos; Recommendation (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RowChangeAction() As Variant
+ RowChangeAction = _PropertyGet(&quot;RowChangeAction&quot;)
+End Property &apos; RowChangeAction (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Source() As Variant
+&apos; Return the object having fired the event: Form, Control or SubForm
+&apos; Else return the root Database object
+ Source = _PropertyGet(&quot;Source&quot;)
+End Function &apos; Source (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SubComponentName() As String
+ SubComponentName = _PropertyGet(&quot;SubComponentName&quot;)
+End Property &apos; SubComponentName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SubComponentType() As Long
+ SubComponentType = _PropertyGet(&quot;SubComponentType&quot;)
+End Property &apos; SubComponentType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get XPos() As Variant
+ XPos = _PropertyGet(&quot;XPos&quot;)
+End Property &apos; XPos (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get YPos() As Variant
+ YPos = _PropertyGet(&quot;YPos&quot;)
+End Property &apos; YPos (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Form.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Form.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub _Initialize(poEvent As Object)
+
+Dim oObject As Object, i As Integer
+Dim sShortcut As String, sAddShortcut As String, sArray() As String
+Dim sImplementation As String, oSelection As Object
+Dim oDatabase As Object
+Const cstDatabaseForm = &quot;com.sun.star.comp.forms.ODatabaseForm&quot;
+
+ If _ErrorHandler() Then On Local Error Goto trace_Error
+
+ Set oObject = poEvent.Source
+ _EventSource = oObject
+ sArray = Split(Utils._getUNOTypeName(poEvent), &quot;.&quot;)
+ _EventType = UCase(sArray(UBound(sArray))
+ If Utils._hasUNOProperty(poEvent, &quot;EventName&quot;) Then _EventName = poEvent.EventName
+
+ Select Case _EventType
+ Case &quot;DOCUMENTEVENT&quot;
+ &apos;SubComponent processing
+ Select Case UCase(_EventName)
+ Case UCase(&quot;OnSubComponentClosed&quot;), UCase(&quot;OnSubComponentOpened&quot;)
+ Set oSelection = poEvent.ViewController.getSelection()(0)
+ _SubComponentName = oSelection.Name
+ With com.sun.star.sdb.application.DatabaseObject
+ Select Case oSelection.Type
+ Case .TABLE : _SubComponentType = acTable
+ Case .QUERY : _SubComponentType = acQuery
+ Case .FORM : _SubComponentType = acForm
+ Case .REPORT : _SubComponentType = acReport
+ Case Else
+ End Select
+ End With
+ Case Else
+ End Select
+ Case &quot;EVENTOBJECT&quot;
+ Case &quot;ACTIONEVENT&quot;
+ Case &quot;FOCUSEVENT&quot;
+ _FocusChangeTemporary = poEvent.Temporary
+ Case &quot;ITEMEVENT&quot;
+ Case &quot;INPUTEVENT&quot;, &quot;KEYEVENT&quot;
+ _KeyCode = poEvent.KeyCode
+ _KeyChar = poEvent.KeyChar
+ _KeyFunction = poEvent.KeyFunc
+ _KeyAlt = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.MOD2)
+ _KeyCtrl = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.MOD1)
+ _KeyShift = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.SHIFT)
+ Case &quot;MOUSEEVENT&quot;
+ _ButtonLeft = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.LEFT)
+ _ButtonRight = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.RIGHT)
+ _ButtonMiddle = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.MIDDLE)
+ _XPos = poEvent.X
+ _YPos = poEvent.Y
+ _ClickCount = poEvent.ClickCount
+ Case &quot;ROWCHANGEEVENT&quot;
+ _RowChangeAction = poEvent.Action
+ Case &quot;TEXTEVENT&quot;
+ Case &quot;ADJUSTMENTEVENT&quot;, &quot;DOCKINGEVENT&quot;, &quot;ENDDOCKINGEVENT&quot;, &quot;ENDPOPUPMODEEVENT&quot;, &quot;ENHANCEDMOUSEEVENT&quot; _
+ , &quot;MENUEVENT&quot;, &quot;PAINTEVENT&quot;, &quot;SPINEVENT&quot;, &quot;VCLCONTAINEREVENT&quot;, &quot;WINDOWEVENT&quot;
+ Goto Exit_Function
+ Case Else
+ Goto Exit_Function
+ End Select
+
+ &apos; Evaluate ContextShortcut
+ oDatabase = Application.CurrentDb()
+ If IsNull(oDatabase) Then Goto Exit_Function
+ sShortcut = &quot;&quot;
+ sImplementation = Utils._ImplementationName(oObject)
+
+ Select Case True
+ Case sImplementation = &quot;stardiv.Toolkit.UnoDialogControl&quot; &apos; Dialog
+ _ContextShortcut = &quot;Dialogs!&quot; &amp; _EventSource.Model.Name
+ Goto Exit_Function
+ Case Left(sImplementation, 16) = &quot;stardiv.Toolkit.&quot; &apos; Control in Dialog
+ _ContextShortcut = &quot;Dialogs!&quot; &amp; _EventSource.Context.Model.Name _
+ &amp; &quot;!&quot; &amp; _EventSource.Model.Name
+ Goto Exit_Function
+ Case Else
+ End Select
+
+ &apos; To manage 2x triggers of &quot;Before record action&quot; form event
+ If _EventType = &quot;ROWCHANGEEVENT&quot; And sImplementation &lt;&gt; &quot;com.sun.star.comp.forms.ODatabaseForm&quot; Then _Recommendation = &quot;IGNORE&quot;
+
+ Do While sImplementation &lt;&gt; &quot;SwXTextDocument&quot;
+ sAddShortcut = &quot;&quot;
+ Select Case sImplementation
+ Case &quot;com.sun.star.comp.forms.OFormsCollection&quot; &apos; Do nothing
+ Case Else
+ If Utils._hasUNOProperty(oObject, &quot;Model&quot;) Then
+ If oObject.Model.Name &lt;&gt; &quot;MainForm&quot; And oObject.Model.Name &lt;&gt; &quot;Form&quot; Then sAddShortcut = Utils._Surround(oObject.Model.Name)
+ ElseIf Utils._hasUNOProperty(oObject, &quot;Name&quot;) Then
+ If oObject.Name &lt;&gt; &quot;MainForm&quot; And oObject.Name &lt;&gt; &quot;Form&quot; Then sAddShortcut = Utils._Surround(oObject.Name)
+ End If
+ If sAddShortcut &lt;&gt; &quot;&quot; Then
+ If sImplementation = cstDatabaseForm And Not oDatabase._Standalone Then sAddShortcut = sAddShortcut &amp; &quot;.Form&quot;
+ sShortcut = sAddShortcut &amp; Iif(Len(sShortcut) &gt; 0, &quot;!&quot; &amp; sShortcut, &quot;&quot;)
+ End If
+ End Select
+ Select Case True
+ Case Utils._hasUNOProperty(oObject, &quot;Model&quot;)
+ Set oObject = oObject.Model.Parent
+ Case Utils._hasUNOProperty(oObject, &quot;Parent&quot;)
+ Set oObject = oObject.Parent
+ Case Else
+ Goto Exit_Function
+ End Select
+ sImplementation = Utils._ImplementationName(oObject)
+ Loop
+ &apos; Add Forms! prefix
+ Select Case oDatabase._Standalone
+ Case False
+ If Utils._hasUNOProperty(oObject, &quot;Args&quot;) Then &apos; Current object is a SwXTextDocument
+ For i = 0 To UBound(oObject.Args)
+ If oObject.Args(i).Name = &quot;DocumentTitle&quot; Then
+ sAddShortcut = Utils._Surround(oObject.Args(i).Value)
+ Exit For
+ End If
+ Next i
+ End If
+ sShortcut = &quot;Forms!&quot; &amp; sAddShortcut &amp; &quot;!&quot; &amp; sShortcut
+ Case True
+ sShortcut = &quot;Forms!0!&quot; &amp; sShortcut
+ End Select
+
+ sArray = Split(sShortcut, &quot;!&quot;)
+ &apos; If presence of &quot;Forms!myform!myform.Form&quot;, eliminate 2nd element
+ If UBound(sArray) &gt;= 2 Then
+ If UCase(sArray(1)) &amp; &quot;.FORM&quot; = UCase(sArray(2)) Then
+ sArray(1) = &quot;&quot;
+ sArray = Utils._TrimArray(sArray)
+ End If
+ End If
+ &apos; If first element ends with .Form, remove suffix
+ If UBound(sArray) &gt;= 1 Then
+ If Len(sArray(1)) &gt; 5 And Right(sArray(1), 5) = &quot;.Form&quot; Then
+ sArray(1) = left(sArray(1), Len(sArray(1)) - 5)
+ sShortcut = Join(sArray, &quot;!&quot;)
+ End If
+ End If
+ If Len(sShortcut) &gt;= 2 Then
+ If Right(sShortcut, 1) = &quot;!&quot; Then
+ _ContextShortcut = Left(sShortcut, Len(sShortcut) - 1)
+ Else
+ _ContextShortcut = sShortcut
+ End If
+ End If
+
+Exit_Function:
+ Exit Sub
+Error_Function:
+ TraceError(TRACEWARNING, Err, &quot;Event.Initialize&quot;, Erl)
+ GoTo Exit_Function
+Trace_Error:
+ &apos; Errors are not displayed to avoid display infinite cycling
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, False, 1)
+ Goto Exit_Function
+End Sub &apos; _Initialize V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+Dim sSubComponentName As String, sSubComponentType As String
+ sSubComponentName = Iif(_SubComponentType &gt; -1, &quot;SubComponentName&quot;, &quot;&quot;)
+ sSubComponentType = Iif(_SubComponentType &gt; -1, &quot;SubComponentType&quot;, &quot;&quot;)
+Dim sXPos As String, sYPos As String
+ sXPos = Iif(IsNull(_XPos), &quot;&quot;, &quot;XPos&quot;)
+ sYPos = Iif(IsNull(_YPos), &quot;&quot;, &quot;YPos&quot;)
+
+ _PropertiesList = Utils._TrimArray(&quot;ButtonLeft&quot;, &quot;ButtonRight&quot;, &quot;ButtonMiddle&quot;, &quot;ClickCount&quot; _
+ , &quot;ContextShortcut&quot;, &quot;EventName&quot;, &quot;EventType&quot;, &quot;FocusChangeTemporary&quot;, _
+ , &quot;KeyAlt&quot;, &quot;KeyChar&quot;, &quot;KeyCode&quot;, &quot;KeyCtrl&quot;, &quot;KeyFunction&quot;, &quot;KeyShift&quot; _
+ , &quot;ObjectType&quot;, &quot;Recommendation&quot;, &quot;RowChangeAction&quot;, &quot;Source&quot; _
+ , sSubComponentName, sSubComponentType, sXPos, sYPos _
+ )
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Event.get&quot; &amp; psProperty)
+Dim vEMPTY As Variant
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;ButtonLeft&quot;)
+ _PropertyGet = _ButtonLeft
+ Case UCase(&quot;ButtonMiddle&quot;)
+ _PropertyGet = _ButtonMiddle
+ Case UCase(&quot;ButtonRight&quot;)
+ _PropertyGet = _ButtonRight
+ Case UCase(&quot;ClickCount&quot;)
+ _PropertyGet = _ClickCount
+ Case UCase(&quot;ContextShortcut&quot;)
+ _PropertyGet = _ContextShortcut
+ Case UCase(&quot;FocusChangeTemporary&quot;)
+ _PropertyGet = _FocusChangeTemporary
+ Case UCase(&quot;EventName&quot;)
+ _PropertyGet = _EventName
+ Case UCase(&quot;EventSource&quot;)
+ _PropertyGet = _EventSource
+ Case UCase(&quot;EventType&quot;)
+ _PropertyGet = _EventType
+ Case UCase(&quot;KeyAlt&quot;)
+ _PropertyGet = _KeyAlt
+ Case UCase(&quot;KeyChar&quot;)
+ _PropertyGet = _KeyChar
+ Case UCase(&quot;KeyCode&quot;)
+ _PropertyGet = _KeyCode
+ Case UCase(&quot;KeyCtrl&quot;)
+ _PropertyGet = _KeyCtrl
+ Case UCase(&quot;KeyFunction&quot;)
+ _PropertyGet = _KeyFunction
+ Case UCase(&quot;KeyShift&quot;)
+ _PropertyGet = _KeyShift
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Recommendation&quot;)
+ _PropertyGet = _Recommendation
+ Case UCase(&quot;RowChangeAction&quot;)
+ _PropertyGet = _RowChangeAction
+ Case UCase(&quot;SubComponentName&quot;)
+ _PropertyGet = _SubComponentName
+ Case UCase(&quot;SubComponentType&quot;)
+ _PropertyGet = _SubComponentType
+ Case UCase(&quot;Source&quot;)
+ If _ContextShortcut = &quot;&quot; Then
+ _PropertyGet = Application.CurrentDb()
+ Else
+ _PropertyGet = getObject(_ContextShortcut)
+ End If
+ Case UCase(&quot;XPos&quot;)
+ If IsNull(_XPos) Then Goto Trace_Error
+ _PropertyGet = _XPos
+ Case UCase(&quot;YPos&quot;)
+ If IsNull(_YPos) Then Goto Trace_Error
+ _PropertyGet = _YPos
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Event.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ &apos; Errors are not displayed to avoid display infinite cycling
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, False, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Event._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Field.xba b/wizards/source/access2base/Field.xba
new file mode 100644
index 000000000000..78431f564587
--- /dev/null
+++ b/wizards/source/access2base/Field.xba
@@ -0,0 +1,738 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Field" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be FIELD
+Private _Name As String
+Private _ParentName As String
+Private _ParentType As String
+Private Column As Object &apos; com.sun.star.sdb.OTableColumnWrapper
+ &apos; or org.openoffice.comp.dbaccess.OQueryColumn
+ &apos; or com.sun.star.sdb.ODataColumn
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJFIELD
+ _Name = &quot;&quot;
+ _ParentName = &quot;&quot;
+ _ParentType = &quot;&quot;
+ Set Column = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get DataType() As Long &apos; AOO/LibO type
+ DataType = _PropertyGet(&quot;DataType&quot;)
+End Property &apos; DataType (get)
+
+Property Get DataUpdatable() As Boolean
+ DataUpdatable = _PropertyGet(&quot;DataUpdatable&quot;)
+End Property &apos; DataUpdatable (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get DbType() As Long &apos; MSAccess type
+ DbType = _PropertyGet(&quot;DbType&quot;)
+End Property &apos; DbType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get DefaultValue() As String
+ DefaultValue = _PropertyGet(&quot;DefaultValue&quot;)
+End Property &apos; DefaultValue (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Description() As String
+ Description = _PropertyGet(&quot;Description&quot;)
+End Property &apos; Description (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FieldSize() As Long
+ FieldSize = _PropertyGet(&quot;FieldSize&quot;)
+End Property &apos; FieldSize (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Size() As Long
+ Size = _PropertyGet(&quot;Size&quot;)
+End Property &apos; Size (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SourceField() As String
+ SourceField = _PropertyGet(&quot;SourceField&quot;)
+End Property &apos; SourceField (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get SourceTable() As String
+ SourceTable = _PropertyGet(&quot;SourceTable&quot;)
+End Property &apos; SourceTable (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get TypeName() As String
+ TypeName = _PropertyGet(&quot;TypeName&quot;)
+End Property &apos; TypeName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Value() As Variant
+ Value = _PropertyGet(&quot;Value&quot;)
+End Property &apos; Value (get)
+
+Property Let Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+Const cstThisSub = &quot;Field.getProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+Const cstThisSub = &quot;Field.hasProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String, sName As String
+Const cstThisSub = &quot;Field.Properties&quot;
+ Utils._SetCalledSub(cstThisSub)
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ sName = _ParentType &amp; &quot;/&quot; &amp; _ParentName &amp; &quot;/&quot; &amp; _Name
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, sName, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, sName, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function ReadAllBytes(ByVal Optional pvFile As Variant) As Boolean
+&apos; Read the whole content of a file into Long Binary Field object
+
+Const cstThisSub = &quot;Field.ReadAllBytes&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If Not Utils._CheckArgument(pvFile, 1, vbString) Then Goto Exit_Function
+ ReadAllBytes = _ReadAll(pvFile, &quot;ReadAllBytes&quot;)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; ReadAllBytes
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function ReadAllText(ByVal Optional pvFile As Variant) As Boolean
+&apos; Read the whole content of a file into a Long Char Field object
+
+Const cstThisSub = &quot;Field.ReadAllText&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If Not Utils._CheckArgument(pvFile, 1, vbString) Then Goto Exit_Function
+ ReadAllText = _ReadAll(pvFile, &quot;ReadAllText&quot;)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; ReadAllText
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function WriteAllBytes(ByVal Optional pvFile As Variant) As Boolean
+&apos; Write the whole content of a Long Binary Field object to a file
+
+Const cstThisSub = &quot;Field.WriteAllBytes&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If Not Utils._CheckArgument(pvFile, 1, vbString) Then Goto Exit_Function
+ WriteAllBytes = _WriteAll(pvFile, &quot;WriteAllBytes&quot;)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; WriteAllBytes
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function WriteAllText(ByVal Optional pvFile As Variant) As Boolean
+&apos; Write the whole content of a Long Char Field object to a file
+
+Const cstThisSub = &quot;Field.WriteAllText&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If Not Utils._CheckArgument(pvFile, 1, vbString) Then Goto Exit_Function
+ WriteAllText = _WriteAll(pvFile, &quot;WriteAllText&quot;)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; WriteAllText
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ Select Case _ParentType
+ Case OBJTABLEDEF
+ _PropertiesList =Array(&quot;DataType&quot;, &quot;dbType&quot;, &quot;DefaultValue&quot; _
+ , &quot;Description&quot;, &quot;Name&quot;, &quot;ObjectType&quot;, &quot;Size&quot;, &quot;SourceField&quot;, &quot;SourceTable&quot; _
+ , &quot;TypeName&quot; _
+ )
+ Case OBJQUERYDEF
+ _PropertiesList = Array(&quot;DataType&quot;, &quot;dbType&quot;, &quot;DefaultValue&quot; _
+ , &quot;Description&quot;, &quot;Name&quot;, &quot;ObjectType&quot;, &quot;Size&quot;, &quot;SourceField&quot;, &quot;SourceTable&quot; _
+ , &quot;TypeName&quot; _
+ )
+ Case OBJRECORDSET
+ _PropertiesList = Array(&quot;DataType&quot;, &quot;DataUpdatable&quot;, &quot;dbType&quot;, &quot;DefaultValue&quot; _
+ , &quot;Description&quot; , &quot;FieldSize&quot;, &quot;Name&quot;, &quot;ObjectType&quot; _
+ , &quot;Size&quot;, &quot;SourceTable&quot;, &quot;TypeName&quot;, &quot;Value&quot; _
+ )
+ End Select
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = &quot;Field.get&quot; &amp; psProperty
+ Utils._SetCalledSub(cstThisSub)
+
+ If Not hasProperty(psProperty) Then Goto Trace_Error
+
+Dim vEMPTY As Variant, bCond1 As Boolean, bCond2 As Boolean, vValue As Variant, oValue As Object, sValue As String
+Dim oSize As Object, lSize As Long, bNullable As Boolean, bNull As Boolean
+Const cstMaxTextLength = 65535
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;DataType&quot;)
+ _PropertyGet = Column.Type
+ Case UCase(&quot;DbType&quot;)
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .BIT : _PropertyGet = dbUndefined
+ Case .TINYINT : _PropertyGet = dbInteger
+ Case .SMALLINT : _PropertyGet = dbLong
+ Case .INTEGER : _PropertyGet = dbLong
+ Case .BIGINT : _PropertyGet = dbBigInt
+ Case .FLOAT : _PropertyGet = dbFloat
+ Case .REAL : _PropertyGet = dbSingle
+ Case .DOUBLE : _PropertyGet = dbDouble
+ Case .NUMERIC : _PropertyGet = dbNumeric
+ Case .DECIMAL : _PropertyGet = dbDecimal
+ Case .CHAR : _PropertyGet = dbText
+ Case .VARCHAR : _PropertyGet = dbChar
+ Case .LONGVARCHAR : _PropertyGet = dbMemo
+ Case .DATE : _PropertyGet = dbDate
+ Case .TIME : _PropertyGet = dbTime
+ Case .TIMESTAMP : _PropertyGet = dbTimeStamp
+ Case .BINARY : _PropertyGet = dbBinary
+ Case .VARBINARY : _PropertyGet = dbVarBinary
+ Case .LONGVARBINARY : _PropertyGet = dbLongBinary
+ Case .BOOLEAN : _PropertyGet = dbBoolean
+ Case Else : _PropertyGet = dbUndefined
+ End Select
+ End With
+ Case UCase(&quot;DataUpdatable&quot;)
+ If Utils._hasUNOProperty(Column, &quot;IsWritable&quot;) Then
+ _PropertyGet = Column.IsWritable
+ ElseIf Utils._hasUNOProperty(Column, &quot;IsReadOnly&quot;) Then
+ _PropertyGet = Not Column.IsReadOnly
+ ElseIf Utils._hasUNOProperty(Column, &quot;IsDefinitelyWritable&quot;) Then
+ _PropertyGet = Column.IsDefinitelyWritable
+ Else
+ _PropertyGet = False
+ End If
+ If Utils._hasUNOProperty(Column, &quot;IsAutoIncrement&quot;) Then
+ If Column.IsAutoIncrement Then _PropertyGet = False &apos; Forces False if auto-increment (MSAccess)
+ End If
+ Case UCase(&quot;DefaultValue&quot;)
+ If Utils._hasUNOProperty(Column, &quot;DefaultValue&quot;) Then &apos; Default value in database set via SQL statement
+ _PropertyGet = Column.DefaultValue
+ ElseIf Utils._hasUNOProperty(Column, &quot;ControlDefault&quot;) Then &apos; Default value set in Base via table edition
+ If IsEmpty(Column.ControlDefault) Then _PropertyGet = &quot;&quot; Else _PropertyGet = Column.ControlDefault
+ Else
+ _PropertyGet = &quot;&quot;
+ End If
+ Case UCase(&quot;Description&quot;)
+ bCond1 = Utils._hasUNOProperty(Column, &quot;Description&quot;)
+ bCond2 = Utils._hasUNOProperty(Column, &quot;HelpText&quot;)
+ Select Case True
+ Case ( bCond1 And bCond2 )
+ If IsEmpty(Column.HelpText) Then _PropertyGet = Column.Description Else _PropertyGet = Column.HelpText
+ Case ( bCond1 And ( Not bCond2 ) )
+ _PropertyGet = Column.Description
+ Case ( ( Not bCond1 ) And bCond2 )
+ _PropertyGet = Column.HelpText
+ Case Else
+ _PropertyGet = &quot;&quot;
+ End Select
+ Case UCase(&quot;FieldSize&quot;) &apos; Probably physical size = 2 * unicode string length
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .LONGVARCHAR
+ Set oSize = Column.getCharacterStream
+ Case .LONGVARBINARY, .VARBINARY, .BINARY
+ Set oSize = Column.getBinaryStream
+ Case Else
+ Set oSize = Nothing
+ End Select
+ End With
+ If Not IsNull(oSize) Then
+ bNullable = ( Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE )
+ If bNullable Then
+ If Column.wasNull() Then _PropertyGet = 0 Else _PropertyGet = CLng(oSize.getLength())
+ Else
+ _PropertyGet = CLng(oSize.getLength())
+ End If
+ oSize.closeInput()
+ Else
+ _PropertyGet = vEMPTY
+ End If
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Size&quot;)
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .LONGVARCHAR, .LONGVARBINARY
+ _PropertyGet = 0 &apos; Always 0 (MSAccess)
+ Case Else
+ If Utils._hasUNOProperty(Column, &quot;Precision&quot;) Then _PropertyGet = Column.Precision Else _PropertyGet = 0
+ End Select
+ End With
+ Case UCase(&quot;SourceField&quot;)
+ Select Case _ParentType
+ Case OBJTABLEDEF
+ _PropertyGet = _Name
+ Case OBJQUERYDEF &apos; RealName = not documented ?!?
+ If Utils._hasUNOProperty(Column, &quot;RealName&quot;) Then _PropertyGet = Column.RealName Else _PropertyGet = _Name
+ End Select
+ Case UCase(&quot;SourceTable&quot;)
+ Select Case _ParentType
+ Case OBJTABLEDEF
+ _PropertyGet = _ParentName
+ Case OBJQUERYDEF, OBJRECORDSET
+ _PropertyGet = Column.TableName
+ End Select
+ Case UCase(&quot;TypeName&quot;)
+ _PropertyGet = Column.TypeName
+ Case UCase(&quot;Value&quot;)
+ bNullable = ( Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE )
+ bNull = False
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .BIT, .BOOLEAN : vValue = Column.getBoolean() &apos; vbBoolean
+ Case .TINYINT : vValue = Column.getShort() &apos; vbInteger
+ Case .SMALLINT, .INTEGER: vValue = Column.getInt() &apos; vbLong
+ Case .BIGINT : vValue = Column.getLong() &apos; vbBigint
+ Case .FLOAT : vValue = Column.getFloat() &apos; vbSingle
+ Case .REAL, .DOUBLE : vValue = Column.getDouble() &apos; vbDouble
+ Case .NUMERIC, .DECIMAL
+ If Utils._hasUNOProperty(Column, &quot;Scale&quot;) Then
+ If Column.Scale &gt; 0 Then
+ vValue = Column.getDouble()
+ Else &apos; CDec checks local decimal point, getString does not !
+ sValue = Join(Split(Column.getString(), &quot;.&quot;), Utils._DecimalPoint())
+ vValue = CDec(sValue)
+ End If
+ Else
+ vValue = CDec(Column.getString())
+ End If
+ Case .CHAR : vValue = Column.getString()
+ Case .VARCHAR : vValue = Column.getString() &apos; vbString
+ Case .LONGVARCHAR
+ Set oValue = Column.getCharacterStream()
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then
+ lSize = CLng(oValue.getLength())
+ oValue.closeInput()
+ If lSize &gt; cstMaxTextLength Then Goto Trace_Length
+ vValue = Column.getString() &apos; vbString
+ Else
+ oValue.closeInput()
+ End If
+ Case .DATE : Set oValue = Column.getDate() &apos; vbObject with members VarType Unsigned Short = 18
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then vValue = DateSerial(CInt(oValue.Year), CInt(oValue.Month), CInt(oValue.Day))
+ Case .TIME : Set oValue = Column.getTime() &apos; vbObject with members VarType Unsigned Short = 18
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then vValue = TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds)&apos;, oValue.HundredthSeconds)
+ Case .TIMESTAMP : Set oValue = Column.getTimeStamp()
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then vValue = DateSerial(CInt(oValue.Year), CInt(oValue.Month), CInt(oValue.Day)) _
+ + TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds)&apos;, oValue.HundredthSeconds)
+ Case .BINARY, .VARBINARY, .LONGVARBINARY
+ Set oValue = Column.getBinaryStream()
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then vValue = CLng(oValue.getLength()) &apos; vbLong =&gt; equivalent to FieldSize
+ oValue.closeInput()
+ Case .BLOB : vValue = Column.getBlob() &apos; TBC HSQLDB 2.0 ?
+ Case .CLOB : vValue = Column.getClob()
+ &apos;getArray
+ &apos;getRef
+ Case Else
+ vValue = Column.getString() &apos;GIVE STRING A TRY
+ If IsNumeric(vValue) Then vValue = Val(vValue) &apos;Required when type = &quot;&quot;, sometimes numeric fields are returned as strings (query/MSAccess)
+ End Select
+ If bNullable Then
+ If Column.wasNull() Then vValue = Nothing &apos;getXXX must precede wasNull()
+ End If
+ End With
+ _PropertyGet = vValue
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Length:
+ TraceError(TRACEFATAL, ERRMEMOLENGTH, Utils._CalledSub(), 0, , lSize)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = &quot;Field.set&quot; &amp; psProperty
+ Utils._SetCalledSub(cstThisSub)
+ _PropertySet = True
+Dim iArgNr As Integer, vTemp As Variant
+Dim oParent As Object
+
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;setProperty&quot;) : iArgNr = 3
+ Case UCase(&quot;Field.setProperty&quot;) : iArgNr = 2
+ Case UCase(cstThisSub) : iArgNr = 1
+ End Select
+
+ If Not hasProperty(psProperty) Then Goto Trace_Error
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Value&quot;)
+ If _ParentType &lt;&gt; OBJRECORDSET Then Goto Trace_Error &apos; Not on table- or querydefs ... !
+ If Not Column.IsWritable Then Goto Trace_Error_Updatable
+ If Column.IsReadOnly Then Goto Trace_Error_Updatable
+ If Application._CurrentDb().Recordsets(_ParentName)._EditMode = dbEditNone Then Goto Trace_Error_Update
+ With com.sun.star.sdbc.DataType
+ If IsNull(pvValue) Then
+ If Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE Then Column.updateNull() Else Goto Trace_Null
+ End If
+ Select Case Column.Type
+ Case .BIT, .BOOLEAN
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ Column.updateBoolean(pvValue)
+ Case .TINYINT
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; -128 Or pvValue &gt; +127 Then Goto Trace_Error_Value
+ Column.updateShort(CInt(pvValue))
+ Case .SMALLINT
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; -32768 Or pvValue &gt; 32767 Then Goto trace_Error_Value
+ Column.updateInt(CLng(pvValue))
+ Case .INTEGER
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; -2147483648 Or pvValue &gt; 2147483647 Then Goto trace_Error_Value
+ Column.updateInt(CLng(pvValue))
+ Case .BIGINT
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ Column.updateLong(pvValue) &apos; No proper type conversion for HYPER data type
+ Case .FLOAT
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Abs(pvValue) &lt; 3.402823E38 And Abs(pvValue) &gt; 1.401298E-45 Then Column.updateFloat(CSng(pvValue)) Else Goto trace_Error_Value
+ Case .REAL, .DOUBLE
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ &apos;If Abs(pvValue) &lt; 1.79769313486232E308 And Abs(pvValue) &gt; 4.94065645841247E-307 Then Column.updateDouble(CDbl(pvValue)) Else Goto trace_Error_Value
+ Column.updateDouble(CDbl(pvValue))
+ Case .NUMERIC, .DECIMAL
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If Utils._hasUNOProperty(Column, &quot;Scale&quot;) Then
+ If Column.Scale &gt; 0 Then
+ &apos;If Abs(pvValue) &lt; 1.79769313486232E308 And Abs(pvValue) &gt; 4.94065645841247E-307 Then Column.updateDouble(CDbl(pvValue)) Else Goto trace_Error_Value
+ Column.updateDouble(CDbl(pvValue))
+ Else
+ Column.updateString(CStr(pvValue))
+ End If
+ Else
+ Column.updateString(CStr(pvValue))
+ End If
+ Case .CHAR, .VARCHAR, .LONGVARCHAR
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ Column.updateString(pvValue) &apos; vbString
+ Case .DATE
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
+ vTemp = New com.sun.star.util.Date
+ With vTemp
+ .Day = Day(pvValue)
+ .Month = Month(pvValue)
+ .Year = Year(pvValue)
+ End With
+ Column.updateDate(vTemp)
+ Case .TIME
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
+ vTemp = New com.sun.star.util.Time
+ With vTemp
+ .Hours = Hour(pvValue)
+ .Minutes = Minute(pvValue)
+ .Seconds = Second(pvValue)
+ &apos;.HundredthSeconds = 0 &apos; replaced with Long nanoSeconds in LO 4.1 ??
+ End With
+ Column.updateTime(vTemp)
+ Case .TIMESTAMP
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
+ vTemp = New com.sun.star.util.DateTime
+ With vTemp
+ .Day = Day(pvValue)
+ .Month = Month(pvValue)
+ .Year = Year(pvValue)
+ .Hours = Hour(pvValue)
+ .Minutes = Minute(pvValue)
+ .Seconds = Second(pvValue)
+ &apos;.HundredthSeconds = 0
+ End With
+ Column.updateTimestamp(vTemp)
+&apos; Case .BINARY, .VARBINARY, .LONGVARBINARY
+&apos; Case .BLOB
+&apos; Case .CLOB
+ Case Else
+ Goto trace_Error
+ End Select
+ End With
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Null:
+ TraceError(TRACEFATAL, ERRNOTNULLABLE, Utils._CalledSub(), 0, 1, _Name)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Update:
+ TraceError(TRACEFATAL, ERRUPDATESEQUENCE, Utils._CalledSub(), 0, 1)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Updatable:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0, 1)
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _ReadAll(ByVal psFile As String, ByVal psMethod As String) As Boolean
+&apos; Write the whole content of a file into a stream object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _ReadAll = False
+
+ If _ParentType &lt;&gt; OBJRECORDSET Then Goto Trace_Error &apos; Not on table- or querydefs ... !
+ If Not Column.IsWritable Then Goto Trace_Error_Updatable
+ If Column.IsReadOnly Then Goto Trace_Error_Updatable
+ If Application._CurrentDb().Recordsets(_ParentName)._EditMode = dbEditNone Then Goto Trace_Error_Update
+
+Dim sFile As String, oSimpleFileAccess As Object, sMethod As String, oStream As Object
+Dim lFileLength As Long, sBuffer As String, sMemo As String, iFile As Integer
+Const cstMaxLength = 64000
+ sFile = _ConvertToURL(psFile)
+
+ oSimpleFileAccess = CreateUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
+ If Not oSimpleFileAccess.exists(sFile) Then Goto Trace_File
+
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .BINARY, .VARBINARY, .LONGVARBINARY
+ If psMethod &lt;&gt; &quot;ReadAllBytes&quot; Then Goto Trace_Error
+ Set oStream = oSimpleFileAccess.openFileRead(sFile)
+ lFileLength = oStream.getLength()
+ If lFileLength = 0 Then Goto Trace_File
+ Column.updateBinaryStream(oStream, lFileLength)
+ oStream.closeInput()
+ Case .LONGVARCHAR
+ If psMethod &lt;&gt; &quot;ReadAllText&quot; Then Goto Trace_Error
+ sMemo = &quot;&quot;
+ lFileLength = 0
+ iFile = FreeFile()
+ Open sFile For Input Access Read Shared As iFile
+ Do While Not Eof(iFile)
+ Line Input #iFile, sBuffer
+ lFileLength = lFileLength + Len(sBuffer) + 1
+ If lFileLength &gt; cstMaxLength Then Exit Do
+ sMemo = sMemo &amp; sBuffer &amp; Chr(10)
+ Loop
+ If lFileLength = 0 Or lFileLength &gt; cstMaxLength Then
+ Close #iFile
+ Goto Trace_File
+ End If
+ sMemo = Left(sMemo, lFileLength - 1)
+ Column.updateString(sMemo)
+ &apos;Column.updateCharacterStream(oStream, lFileLength) &apos; DOES NOT WORK ?!?
+ Case Else
+ Goto Trace_Error
+ End Select
+ End With
+
+ _ReadAll = True
+
+Exit_Function:
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , psMethod)
+ Goto Exit_Function
+Trace_File:
+ TraceError(TRACEFATAL, ERRFILEACCESS, Utils._CalledSub(), 0, , sFile)
+ If Not IsNull(oStream) Then oStream.closeInput()
+ Goto Exit_Function
+Trace_Error_Update:
+ TraceError(TRACEFATAL, ERRUPDATESEQUENCE, Utils._CalledSub(), 0, 1)
+ If Not IsNull(oStream) Then oStream.closeInput()
+ Goto Exit_Function
+Trace_Error_Updatable:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0, 1)
+ If Not IsNull(oStream) Then oStream.closeInput()
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, _CalledSub, Erl)
+ GoTo Exit_Function
+End Function &apos; ReadAll
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _WriteAll(ByVal psFile As String, ByVal psMethod As String) As Boolean
+&apos; Write the whole content of a stream object to a file
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _WriteAll = False
+
+Dim sFile As String, oSimpleFileAccess As Object, sMethod As String, oStream As Object
+ sFile = _ConvertToURL(psFile)
+
+ oSimpleFileAccess = CreateUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
+ With com.sun.star.sdbc.DataType
+ Select Case Column.Type
+ Case .BINARY, .VARBINARY, .LONGVARBINARY
+ If psMethod &lt;&gt; &quot;WriteAllBytes&quot; Then Goto Trace_Error
+ Set oStream = Column.getBinaryStream()
+ Case .LONGVARCHAR
+ If psMethod &lt;&gt; &quot;WriteAllText&quot; Then Goto Trace_Error
+ Set oStream = Column.getCharacterStream()
+ Case Else
+ Goto Trace_Error
+ End Select
+ End With
+
+ If Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE Then
+ If Column.wasNull() Then Goto Trace_Null
+ End If
+ If oStream.getLength() = 0 Then Goto Trace_Null
+ On Local Error Goto Trace_File
+ If oSimpleFileAccess.exists(sFile) Then oSimpleFileAccess.kill(sFile)
+ oSimpleFileAccess.writeFile(sFile, oStream)
+ On Local Error Goto Error_Function
+ oStream.closeInput()
+
+ _WriteAll = True
+
+Exit_Function:
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , psMethod)
+ Goto Exit_Function
+Trace_File:
+ TraceError(TRACEFATAL, ERRFILEACCESS, Utils._CalledSub(), 0, , sFile)
+ If Not IsNull(oStream) Then oStream.closeInput()
+ Goto Exit_Function
+Trace_Null:
+ TraceError(TRACEFATAL, ERRFIELDNULL, _CalledSub, 0)
+ If Not IsNull(oStream) Then oStream.closeInput()
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, _CalledSub, Erl)
+ GoTo Exit_Function
+End Function &apos; WriteAll
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Form.xba b/wizards/source/access2base/Form.xba
new file mode 100644
index 000000000000..43581aa84555
--- /dev/null
+++ b/wizards/source/access2base/Form.xba
@@ -0,0 +1,821 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Form" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be FORM
+Private _Shortcut As String
+Private _Name As String
+Private _IsLoaded As Boolean
+Private _OpenArgs As Variant
+Public Component As Object &apos; com.sun.star.text.TextDocument
+Public ContainerWindow As Object &apos; (No name)
+Public DatabaseForm As Object &apos; com.sun.star.form.component.DataForm and com.sun.star.sdb.ResultSet (a.o.)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJFORM
+ _Shortcut = &quot;&quot;
+ _Name = &quot;&quot;
+ _IsLoaded = False
+ _OpenArgs = &quot;&quot;
+ Set Component = Nothing
+ Set ContainerWindow = Nothing
+ Set DatabaseForm = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowAdditions() As Variant
+ AllowAdditions = _PropertyGet(&quot;AllowAdditions&quot;)
+End Property &apos; AllowAdditions (get)
+
+Property Let AllowAdditions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowAdditions&quot;, pvValue)
+End Property &apos; AllowAdditions (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowDeletions() As Variant
+ AllowDeletions = _PropertyGet(&quot;AllowDeletions&quot;)
+End Property &apos; AllowDeletions (get)
+
+Property Let AllowDeletions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowDeletions&quot;, pvValue)
+End Property &apos; AllowDeletions (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowEdits() As Variant
+ AllowEdits = _PropertyGet(&quot;AllowEdits&quot;)
+End Property &apos; AllowEdits (get)
+
+Property Let AllowEdits(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowEdits&quot;, pvValue)
+End Property &apos; AllowEdits (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Bookmark() As Variant
+ Bookmark = _PropertyGet(&quot;Bookmark&quot;)
+End Property &apos; Bookmark (get)
+
+Property Let Bookmark(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Bookmark&quot;, pvValue)
+End Property &apos; Bookmark (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Caption() As Variant
+ Caption = _PropertyGet(&quot;Caption&quot;)
+End Property &apos; Caption (get)
+
+Property Let Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get CurrentRecord() As Variant
+ CurrentRecord = _PropertyGet(&quot;CurrentRecord&quot;)
+End Property &apos; CurrentRecord (get)
+
+Property Let CurrentRecord(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;CurrentRecord&quot;, pvValue)
+End Property &apos; CurrentRecord (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Filter() As Variant
+ Filter = _PropertyGet(&quot;Filter&quot;)
+End Property &apos; Filter (get)
+
+Property Let Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FilterOn() As Variant
+ FilterOn = _PropertyGet(&quot;FilterOn&quot;)
+End Property &apos; FilterOn (get)
+
+Property Let FilterOn(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FilterOn&quot;, pvValue)
+End Property &apos; FilterOn (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Height() As Variant
+ Height = _PropertyGet(&quot;Height&quot;)
+End Property &apos; Height (get)
+
+Property Let Height(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Height&quot;, pvValue)
+End Property &apos; Height (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get IsLoaded() As Boolean
+&apos;Return True if form open
+
+ If _ErrorHandler() Then On Local Error Goto Error_Property
+ Utils._SetCalledSub(&quot;Form.getIsLoaded&quot;)
+ If _IsLoaded Then &apos; For performance reasons, a form object, once detected as loaded, is presumed remaining loaded
+ IsLoaded = True
+ Goto Exit_Property
+ End If
+ IsLoaded = False
+
+Dim oDatabase As Object, oEnum As Object, oDesk As Object, oComp As Object, bFound As Boolean
+Dim i As Integer
+ Set oDatabase = Application._CurrentDb()
+ Set oDesk = CreateUnoService(&quot;com.sun.star.frame.Desktop&quot;)
+ Set oEnum = oDesk.Components().createEnumeration
+ bFound = False
+ While oEnum.hasMoreElements And Not bFound &apos; Search in all open components if one corresponds with current form
+ oComp = oEnum.nextElement
+ Select Case oDatabase._Standalone
+ Case False
+ If HasUnoInterfaces(oComp, &quot;com.sun.star.frame.XModule&quot;) Then
+ If oComp.Identifier = &quot;com.sun.star.sdb.FormDesign&quot; Then
+ For i = 0 To UBound(oComp.Args())
+ If oComp.Args(i).Name = &quot;DocumentTitle&quot; Then
+ bFound = ( oComp.Args(i).Value = _Name )
+ If bFound Then
+ _IsLoaded = True
+ Set Component = oComp
+ Exit For
+ End If
+ End If
+ Next i
+ End If
+ End If
+ Case True
+ If Utils._hasUNOProperty(oComp, &quot;ImplementationName&quot;) Then
+ If oComp.ImplementationName = &quot;SwXTextDocument&quot; Then
+ If oComp.Title = oDatabase.Title Then
+ _IsLoaded = True
+ Set Component = oDatabase.Document &apos; Form
+ End If
+ End If
+ End If
+ End Select
+ Wend
+ Set oComp = Nothing
+ IsLoaded = _IsLoaded
+
+Exit_Property:
+ Utils._ResetCalledSub(&quot;Form.getIsLoaded&quot;)
+ Exit Property
+Error_Property:
+ TraceError(TRACEABORT, Err, &quot;Form.getIsLoaded&quot;, Erl)
+ GoTo Exit_Property
+End Property
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get OpenArgs() As Variant
+ OpenArgs = _PropertyGet(&quot;OpenArgs&quot;)
+End Property &apos; OpenArgs (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OptionGroup(ByVal Optional pvGroupName As Variant) As Variant
+&apos; Return either an error or an object of type OPTIONGROUP based on its name
+
+ Utils._SetCalledSub(&quot;Form.OptionGroup&quot;)
+ If IsMissing(pvGroupName) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Set OptionGroup = _OptionGroup(pvGroupName, CTLPARENTISFORM, DatabaseForm, Component)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.OptionGroup&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.OptionGroup&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OptionGroup
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Recordset() As Object
+ Recordset = _PropertyGet(&quot;Recordset&quot;)
+End Property &apos; Recordset (get) V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RecordSource() As Variant
+ RecordSource = _PropertyGet(&quot;RecordSource&quot;)
+End Property &apos; RecordSource (get)
+
+Property Let RecordSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RecordSource&quot;, pvValue)
+End Property &apos; RecordSource (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Visible() As Variant
+ Visible = _PropertyGet(&quot;Visible&quot;)
+End Property &apos; Visible (get)
+
+Property Let Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Width() As Variant
+ Width = _PropertyGet(&quot;Width&quot;)
+End Property &apos; Width (get)
+
+Property Let Width(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Width&quot;, pvValue)
+End Property &apos; Width (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function mClose() As Variant
+&apos; Close the form
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Form.Close&quot;)
+ mClose = False
+ If _TraceStandalone() Then Goto Exit_Function
+
+Dim oController As Object
+ Set oController = Application.CurrentDb().Document.getFormDocuments.getByName(_Name)
+ oController.close()
+ mClose = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.Close&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.Close&quot;, Erl)
+ GoTo Exit_Function
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
+&apos; Return a Control object with name or index = pvIndex
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Form.Controls&quot;)
+
+Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
+Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
+Dim j As Integer
+
+ Set ocControl = Nothing
+ If Not IsLoaded Then Goto Trace_Error_NotOpen
+ Set ocControl = New Control
+ ocControl._ParentType = CTLPARENTISFORM
+ sParentShortcut = _Shortcut
+ iControlCount = DatabaseForm.getCount()
+
+ If IsMissing(pvIndex) Then &apos; No argument, return Collection pseudo-object
+ Set oCounter = New Collect
+ oCounter._CollType = COLLCONTROLS
+ oCounter._ParentType = OBJFORM
+ oCounter._ParentName = _Name
+ oCounter._Count = iControlCount
+ Set Controls = oCounter
+ Goto Exit_Function
+ End If
+
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+
+ &apos; Start building the ocControl object
+ &apos; Determine exact name
+ sControls() = DatabaseForm.getElementNames()
+
+ Select Case VarType(pvIndex)
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
+ ocControl._Name = sControls(pvIndex)
+ Case vbString &apos; Check control name validity (non case sensitive)
+ bFound = False
+ sIndex = UCase(Utils._Trim(pvIndex))
+ For i = 0 To iControlCount - 1
+ If UCase(sControls(i)) = sIndex Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
+ End Select
+
+ ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
+ Set ocControl.ControlModel = DatabaseForm.getByName(ocControl._Name)
+ ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
+ ocControl._FormComponent = Component
+ If Utils._hasUNOProperty(ocControl.ControlModel, &quot;ClassId&quot;) Then ocControl._ClassId = ocControl.ControlModel.ClassId
+ If ocControl._ClassId &gt; 0 And ocControl._ClassId &lt;&gt; acHiddenControl Then
+ Set ocControl.ControlView = Component.CurrentController.getControl(ocControl.ControlModel)
+ End If
+
+ ocControl._Initialize()
+ Set Controls = ocControl
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.Controls&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , iArg)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_NotOpen:
+ TraceError(TRACEFATAL, ERRFORMNOTOPEN, Utils._CalledSub(), 0, , _Name)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, pvIndex))
+ Set Controls = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.Controls&quot;, Erl)
+ Set Controls = Nothing
+ GoTo Exit_Function
+End Function &apos; Controls
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Form.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Form.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Move( ByVal Optional pvLeft As Variant _
+ , ByVal Optional pvTop As Variant _
+ , ByVal Optional pvWidth As Variant _
+ , ByVal Optional pvHeight As Variant _
+ ) As Variant
+&apos; Execute Move method
+ Utils._SetCalledSub(&quot;Form.Move&quot;)
+ If IsMissing(pvLeft) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Move = False
+Dim iArgNr As Integer
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;Move&quot;) : iArgNr = 1
+ Case UCase(&quot;Form.Move&quot;) : iArgNr = 0
+ End Select
+ If IsMissing(pvLeft) Then Call _TraceArguments()
+ If IsMissing(pvTop) Then pvTop = -1
+ If IsMissing(pvWidth) Then pvWidth = -1
+ If IsMissing(pvHeight) Then pvHeight = -1
+ If Not Utils._CheckArgument(pvLeft, iArgNr + 1, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvTop, iArgNr + 2, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvWidth, iArgNr + 3, Utils._AddNumeric()) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvHeight, iArgNr + 4, Utils._AddNumeric()) Then Goto Exit_Function
+
+Dim iArg As Integer &apos; Check arguments values
+ iArg = 0
+ If pvHeight &lt; -1 Then iArg = 4 : If pvWidth &lt; -1 Then iArg = 3
+ If pvTop &lt; -1 Then iArg = 2 : If pvLeft &lt; -1 Then iArg = 1
+ If iArg &gt; 0 Then
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, iArgNr + iArg)
+ Goto Exit_Function
+ End If
+
+Dim iPosSize As Integer
+ iPosSize = 0
+ If pvLeft &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.X
+ If pvTop &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.Y
+ If pvWidth &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.WIDTH
+ If pvHeight &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.HEIGHT
+ If iPosSize &gt; 0 Then ContainerWindow.setPosSize(pvLeft, pvTop, pvWidth, pvHeight, iPosSize)
+ Move = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.Move&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.Move&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Move
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Refresh() As Boolean
+&apos; Refresh data with its most recent value in the database in a form or subform
+ Utils._SetCalledSub(&quot;Form.Refresh&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Refresh = False
+
+Dim oSet As Object
+ Set oSet = DatabaseForm.createResultSet()
+ If Not IsNull(oSet) Then
+ oSet.refreshRow()
+ Refresh = True
+ End If
+
+Exit_Function:
+ Set oSet = Nothing
+ Utils._ResetCalledSub(&quot;Form.Refresh&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.Refresh&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Refresh
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Requery() As Boolean
+&apos; Refresh data displayed in a form, subform, combobox or listbox
+ Utils._SetCalledSub(&quot;Form.Requery&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Requery = False
+
+ DatabaseForm.reload()
+ Requery = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.Requery&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.Requery&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Requery
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFocus() As Boolean
+&apos; Execute setFocus method
+ Utils._SetCalledSub(&quot;Form.setFocus&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ setFocus = False
+
+ ContainerWindow.toFront()
+ setFocus = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.setFocus&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form.setFocus&quot;, Erl)
+ Goto Exit_Function
+End Function &apos; setFocus
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;Form.setProperty&quot;)
+ setProperty = _PropertySet(psProperty, pvValue)
+ Utils._ResetCalledSub(&quot;Form.setProperty&quot;)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub _Initialize(psName As String)
+&apos; Set pointers to UNO objects
+
+Dim oDatabase As Object, oFormsCollection As Object
+ If _ErrorHandler() Then On Local Error Goto Trace_Error
+ _Name = psName
+ _Shortcut = &quot;Forms!&quot; &amp; Utils._Surround(psName)
+ Set oDatabase = Application._CurrentDb()
+ If IsLoaded Then
+ Select Case oDatabase._Standalone
+ Case False
+ If Not IsNull(Component.CurrentController) Then &apos; A form opened then closed afterwards keeps a Component attribute
+ Set ContainerWindow = Component.CurrentController.Frame.ContainerWindow
+ Set oFormsCollection = Component.getDrawPage.Forms
+ If oFormsCollection.hasByName(&quot;MainForm&quot;) Then
+ Set DatabaseForm = oFormsCollection.getByName(&quot;MainForm&quot;)
+ ElseIf oFormsCollection.hasByName(&quot;Form&quot;) Then
+ Set DatabaseForm = oFormsCollection.getByName(&quot;Form&quot;)
+ ElseIf oFormsCollection.hasByName(_Name) Then
+ Set DatabaseForm = oFormsCollection.getByName(_Name)
+ Else
+ Goto Trace_Internal_Error
+ End If
+ End If
+ Case True
+ Set ContainerWindow = oDatabase.Document.CurrentController.Frame.ContainerWindow
+ Set DatabaseForm = oDatabase.Form
+ End Select
+ Else
+ Set Component = Nothing
+ Set ContainerWindow = Nothing
+ Set DatabaseForm = Nothing
+ End If
+
+Exit_Sub:
+ Exit Sub
+Trace_Error:
+ TraceError(TRACEABORT, Err, &quot;Form.Initialize&quot;, Erl)
+ Goto Exit_Sub
+Trace_Internal_Error:
+ TraceError(TRACEABORT, ERRFORMNOTIDENTIFIED, Utils._CalledSub(), 0, , _Name)
+ Goto Exit_Sub
+End Sub &apos; _Initialize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ If IsLoaded Then
+ _PropertiesList = Array(&quot;AllowAdditions&quot;, &quot;AllowDeletions&quot;, &quot;AllowEdits&quot;, &quot;Bookmark&quot; _
+ , &quot;Caption&quot;, &quot;CurrentRecord&quot;, &quot;Filter&quot;, &quot;FilterOn&quot;, &quot;Height&quot;, &quot;IsLoaded&quot; _
+ , &quot;Name&quot;, &quot;ObjectType&quot;, &quot;OpenArgs&quot; _
+ , &quot;RecordSource&quot;, &quot;Visible&quot;, &quot;Width&quot; _
+ ) &apos; Recordset removed
+ Else
+ _PropertiesList = Array(&quot;IsLoaded&quot;, &quot;Name&quot; _
+ )
+ End If
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Form.get&quot; &amp; psProperty)
+
+&apos;Execute
+Dim oDatabase As Object, vBookmark As Variant, vEMPTY As Variant
+Dim oObject As Object
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Name&quot;), UCase(&quot;IsLoaded&quot;)
+ Case Else : If Not IsLoaded Then Goto Trace_Error_Form
+ End Select
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AllowAdditions&quot;)
+ _PropertyGet = DatabaseForm.AllowInserts
+ Case UCase(&quot;AllowDeletions&quot;)
+ _PropertyGet = DatabaseForm.AllowDeletes
+ Case UCase(&quot;AllowEdits&quot;)
+ _PropertyGet = DatabaseForm.AllowUpdates
+ Case UCase(&quot;Bookmark&quot;)
+ On Local Error Resume Next &apos; Disable error handler because bookmarking does not always react well in events ...
+ If DatabaseForm.IsBookmarkable Then vBookmark = DatabaseForm.getBookmark() Else vBookmark = Nothing
+ On Local Error Goto Error_Function
+ If IsNull(vBookmark) Then Goto Trace_Error
+ _PropertyGet = vBookmark
+ Case UCase(&quot;Caption&quot;)
+ Set odatabase = Application._CurrentDb()
+ Select Case oDatabase._Standalone
+ Case True : _PropertyGet = oDatabase.Document.CurrentController.Frame.Title
+ Case False : _PropertyGet = Component.CurrentController.Frame.Title
+ End Select
+ Case UCase(&quot;CurrentRecord&quot;)
+ _PropertyGet = DatabaseForm.Row
+ Case UCase(&quot;Filter&quot;)
+ _PropertyGet = DatabaseForm.Filter
+ Case UCase(&quot;FilterOn&quot;)
+ _PropertyGet = DatabaseForm.ApplyFilter
+ Case UCase(&quot;Height&quot;)
+ _PropertyGet = ContainerWindow.getPosSize().Height
+ Case UCase(&quot;IsLoaded&quot;) &apos; Only for indirect access from property object
+ _PropertyGet = IsLoaded
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;OpenArgs&quot;)
+ _PropertyGet = _OpenArgs
+ Case UCase(&quot;Recordset&quot;)
+ If DatabaseForm.Command = &quot;&quot; Then Goto Trace_Error &apos; No underlying data ??
+ Set oObject = New Recordset
+ With DatabaseForm
+ oObject._CommandType = DatabaseForm.CommandType
+ oObject._Command = DatabaseForm.Command
+ oObject._ParentName = _Name
+ oObject._ParentType = _Type
+ oObject._ForwardOnly = ( .ResultSetType = com.sun.star.sdbc.ResultSetType.FORWARD_ONLY )
+ oObject._PassThrough = ( .EscapeProcessing = False )
+ oObject._ReadOnly = ( .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY )
+ Call oObject._Initialize()
+ End With
+ Set oDatabase = Application._CurrentDb()
+ With oDatabase
+ .RecordsetMax = .RecordsetMax + 1
+ oObject._Name = Format(.RecordsetMax, &quot;0000000&quot;)
+ .RecordsetsColl.Add(oObject, UCase(oObject._Name))
+ End With
+ Set _PropertyGet = oObject
+ Case UCase(&quot;RecordSource&quot;)
+ _PropertyGet = DatabaseForm.ActiveCommand
+ Case UCase(&quot;Visible&quot;)
+ _PropertyGet = ContainerWindow.IsVisible()
+ Case UCase(&quot;Width&quot;)
+ _PropertyGet = ContainerWindow.getPosSize().Width
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Error_Form:
+ TraceError(TRACEFATAL, ERRFORMNOTOPEN, Utils._CalledSub(), 0, 1, _Name)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+
+ Utils._SetCalledSub(&quot;Form.set&quot; &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _PropertySet = True
+
+&apos;Execute
+Dim iArgNr As Integer
+Dim oDatabase As Object
+
+ If Len(_A2B_.CalledSub) &gt; 5 And Left(_A2B_.CalledSub, 5) = &quot;Form.&quot; Then iArgNr = 1 Else iArgNr = 2
+ If Not IsLoaded Then Goto Trace_Error_Form
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AllowAdditions&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowInserts = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;AllowDeletions&quot;)
+ If Not Utils._CheckArgument(pvValue,iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowDeletes = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;AllowEdits&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowUpdates = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;Bookmark&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(vbObject), , False) Then Goto Trace_Error_Value
+ If IsNull(pvValue) Then Goto Trace_Error_Value
+ DatabaseForm.MoveToBookmark(pvValue)
+ Case UCase(&quot;Caption&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ Set oDatabase = Application._CurrentDb()
+ Select Case oDatabase._Standalone
+ Case True : oDatabase.Document.CurrentController.Frame.Title = pvValue
+ Case False : Component.CurrentController.Frame.Title = pvValue
+ End Select
+ Case UCase(&quot;CurrentRecord&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 1 Then Goto Trace_Error_Value
+ DatabaseForm.absolute(pvValue)
+ Case UCase(&quot;Filter&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ DatabaseForm.Filter = Utils._ReplaceSquareBrackets(pvValue)
+ Case UCase(&quot;FilterOn&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.ApplyFilter = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;Height&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ ContainerWindow.setPosSize(0, 0, 0, pvValue, com.sun.star.awt.PosSize.HEIGHT)
+ Case UCase(&quot;RecordSource&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ DatabaseForm.Command = Utils._ReplaceSquareBrackets(pvValue)
+ DatabaseForm.CommandType = com.sun.star.sdb.CommandType.COMMAND
+ DatabaseForm.Filter = &quot;&quot;
+ DatabaseForm.reload()
+ Case UCase(&quot;Visible&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ ContainerWindow.setVisible(pvValue)
+ Case UCase(&quot;Width&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric()) Then Goto Trace_Error_Value
+ ContainerWindow.setPosSize(0, 0, pvValue, 0, com.sun.star.awt.PosSize.WIDTH)
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Form.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error_Form:
+ TraceError(TRACEFATAL, ERRFORMNOTOPEN, Utils._CalledSub(), 0, 1, _Name)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Form._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set AllowAdditions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowAdditions&quot;, pvValue)
+End Property &apos; AllowAdditions (set)
+
+Property Set AllowDeletions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowDeletions&quot;, pvValue)
+End Property &apos; AllowDeletions (set)
+
+Property Set AllowEdits(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowEdits&quot;, pvValue)
+End Property &apos; AllowEdits (set)
+
+Property Set Bookmark(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Bookmark&quot;, pvValue)
+End Property &apos; Bookmark (set)
+
+Property Set Caption(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Caption&quot;, pvValue)
+End Property &apos; Caption (set)
+
+Property Set CurrentRecord(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;CurrentRecord&quot;, pvValue)
+End Property &apos; CurrentRecord (set)
+
+Property Set Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+Property Set FilterOn(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FilterOn&quot;, pvValue)
+End Property &apos; FilterOn (set)
+
+Property Set Height(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Height&quot;, pvValue)
+End Property &apos; Height (set)
+
+Property Set RecordSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RecordSource&quot;, pvValue)
+End Property &apos; RecordSource (set)
+
+Property Set Visible(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Visible&quot;, pvValue)
+End Property &apos; Visible (set)
+
+Property Set Width(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Width&quot;, pvValue)
+End Property &apos; Width (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/L10N.xba b/wizards/source/access2base/L10N.xba
new file mode 100644
index 000000000000..d95a8ce387c7
--- /dev/null
+++ b/wizards/source/access2base/L10N.xba
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="L10N" script:language="StarBasic">Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function _GetLabel(ByVal psShortlabel As String, Optional ByVal psLocale As String) As String
+&apos; Return the localized label corresponding with ShortLabel
+
+ If IsMissing(psLocale) Then psLocale = UCase(Left(_GetLocale(), 2)) Else psLocale = UCase(psLocale)
+ On Local Error Goto Error_Function
+ If Not Utils._InList(psLocale, Array( _
+ &quot;EN&quot;, &quot;FR&quot; _
+ )) Then psLocale = &quot;DEFAULT&quot; &apos; If list incomplete a recursive call will be provided anyway
+
+Dim sLocal As String
+ sLocal = psShortLabel
+ Select Case psLocale
+ Case &quot;EN&quot;, &quot;DEFAULT&quot;
+ Select Case UCase(psShortlabel)
+ Case &quot;ERR&quot; &amp; ERRNOTDATABASE : sLocal = &quot;The open document is not an OpenOffice/LibreOffice Database Document&quot;
+ Case &quot;ERR&quot; &amp; ERRDBNOTCONNECTED : sLocal = &quot;Database connection not established&quot;
+ Case &quot;ERR&quot; &amp; ERRMISSINGARGUMENTS : sLocal = &quot;Arguments are missing or are not initialized&quot;
+ Case &quot;ERR&quot; &amp; ERRWRONGARGUMENT : sLocal = &quot;Argument nr. %0 [Value = &apos;%1&apos;] is invalid&quot;
+ Case &quot;ERR&quot; &amp; ERRMAINFORM : sLocal = &quot;Document &apos;%0&apos; does not contain exactly 1 main form (either none or &gt; 1)&quot;
+ Case &quot;ERR&quot; &amp; ERRSTANDALONE : sLocal = &quot;Property or method must not be called from a standalone form&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTIDENTIFIED : sLocal = &quot;Form &apos;%0&apos; not identified in database Forms set&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTFOUND : sLocal = &quot;Form &apos;%0&apos; not found&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTOPEN : sLocal = &quot;Form &apos;%0&apos; is currently not open&quot;
+ Case &quot;ERR&quot; &amp; ERRDFUNCTION : sLocal = &quot;DFunction execution failed, SQL=%0&quot;
+ Case &quot;ERR&quot; &amp; ERROPENFORM : sLocal = &quot;Form &apos;%0&apos; could not be opened&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTY : sLocal = &quot;Property &apos;%0&apos; not applicable in this context&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYVALUE : sLocal = &quot;Value &apos;%0&apos; is invalid for property &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRINDEXVALUE : sLocal = &quot;Out of array range or incorrect array size for property &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRCOLLECTION : sLocal = &quot;Out of array range&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYNOTARRAY : sLocal = &quot;Argument nr.%0 should be an array&quot;
+ Case &quot;ERR&quot; &amp; ERRCONTROLNOTFOUND : sLocal = &quot;Control &apos;%0&apos; not found in parent (form, grid or dialog) &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRNOACTIVEFORM : sLocal = &quot;No active form or control found&quot;
+ Case &quot;ERR&quot; &amp; ERRDATABASEFORM : sLocal = &quot;Form &apos;%0&apos; has no underlying dataset&quot;
+ Case &quot;ERR&quot; &amp; ERRFOCUSINGRID : sLocal = &quot;Control &apos;%0&apos; not found in gridcontrol &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRNOGRIDINFORM : sLocal = &quot;No gridcontrol found in form &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRFINDRECORD : sLocal = &quot;FindNext() must be preceded by a successful FindRecord(...) call&quot;
+ Case &quot;ERR&quot; &amp; ERRSQLSTATEMENT : sLocal = &quot;SQL Error, SQL statement = &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERROBJECTNOTFOUND : sLocal = &quot;%0 &apos;%1&apos; not found&quot;
+ Case &quot;ERR&quot; &amp; ERROPENOBJECT : sLocal = &quot;%0 &apos;%1&apos; could not be opened&quot;
+ Case &quot;ERR&quot; &amp; ERRCLOSEOBJECT : sLocal = &quot;%0 &apos;%1&apos; could not be closed&quot;
+ Case &quot;ERR&quot; &amp; ERRMETHOD : sLocal = &quot;Method not applicable in this context&quot;
+ Case &quot;ERR&quot; &amp; ERRACTION : sLocal = &quot;Action not applicable in this context&quot;
+ Case &quot;ERR&quot; &amp; ERRSENDMAIL : sLocal = &quot;Mail service could not be activated&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMYETOPEN : sLocal = &quot;Form %0 is already open&quot;
+ Case &quot;ERR&quot; &amp; ERRMETHOD : sLocal = &quot;Method &apos;%0&apos; not applicable in this context&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYINIT : sLocal = &quot;Property &apos;%0&apos; applicable but not initialized&quot;
+ Case &quot;ERR&quot; &amp; ERRFILENOTCREATED : sLocal = &quot;File &apos;%0&apos; could not be created&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGNOTFOUND : sLocal = &quot;Dialog &apos;%0&apos; not found in the currently loaded libraries&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGUNDEFINED : sLocal = &quot;Dialog unknown&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGSTARTED : sLocal = &quot;Dialog already started&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGNOTSTARTED : sLocal = &quot;Dialog &apos;%0&apos; not active&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETNODATA : sLocal = &quot;Recordset delivered no data. Action on current record rejected&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETCLOSED : sLocal = &quot;Recordset has been closed. Recordset action rejected&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETRANGE : sLocal = &quot;Current record out of range&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETFORWARD : sLocal = &quot;Action rejected in a forward-only or not bookmarkable recordset&quot;
+ Case &quot;ERR&quot; &amp; ERRFIELDNULL : sLocal = &quot;Field is null or empty. Action rejected&quot;
+ Case &quot;ERR&quot; &amp; ERRFILEACCESS : sLocal = &quot;File access error on file &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRMEMOLENGTH : sLocal = &quot;Field length (%0) exceeds maximum length. Use WriteAllText instead&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTACTIONQUERY : sLocal = &quot;Query &apos;%0&apos; is not an action query&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTUPDATABLE : sLocal = &quot;Recordset or field is not updatable&quot;
+ Case &quot;ERR&quot; &amp; ERRUPDATESEQUENCE : sLocal = &quot;Recordset update sequence error&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTNULLABLE : sLocal = &quot;Field &apos;%0&apos; must not contain a NULL value&quot;
+ Case &quot;ERR&quot; &amp; ERRROWDELETED : sLocal = &quot;Current row has been deleted&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETCLONE : sLocal = &quot;Cloning a cloned Recordset is forbidden&quot;
+ Case &quot;ERR&quot; &amp; ERRQUERYDEFDELETED : sLocal = &quot;Pre-existing query &apos;%0&apos; has been deleted&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;TABLE&quot; : sLocal = &quot;Table&quot;
+ Case &quot;QUERY&quot; : slocal = &quot;Query&quot;
+ Case &quot;FORM&quot; : sLocal = &quot;Form&quot;
+ Case &quot;REPORT&quot; : sLocal = &quot;Report&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;ERR#&quot; : sLocal = &quot;Error #&quot;
+ Case &quot;ERROCCUR&quot; : sLocal = &quot;occurred&quot;
+ Case &quot;ERRLINE&quot; : sLocal = &quot;at line&quot;
+ Case &quot;ERRIN&quot; : sLocal = &quot;in&quot;
+ Case &quot;CALLTO&quot; : sLocal = &quot;a call to function&quot;
+ Case &quot;SAVECONSOLE&quot; : sLocal = &quot;Save console&quot;
+ Case &quot;SAVECONSOLEENTRIES&quot; : sLocal = &quot;The console entries have been saved successfully.&quot;
+ Case &quot;QUITSHORT&quot; : sLocal = &quot;Quit&quot;
+ Case &quot;QUIT&quot; : sLocal = &quot;Do you really want to quit the application ? Changed data will be saved.&quot;
+ Case &quot;ENTERING&quot; : sLocal = &quot;Entering&quot;
+ Case &quot;EXITING&quot; : sLocal = &quot;Exiting&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;DLGTRACE_HELP&quot; : sLocal = &quot;Manage the console buffer and its entries&quot;
+ Case &quot;DLGTRACE_TITLE&quot; : sLocal = &quot;Console&quot;
+ Case &quot;DLGTRACE_LBLENTRIES_HELP&quot; : sLocal = &quot;Clear the list and resize the circular buffer&quot;
+ Case &quot;DLGTRACE_LBLENTRIES_LABEL&quot; : sLocal = &quot;Set max number of entries&quot;
+ Case &quot;DLGTRACE_TXTTRACELOG_HELP&quot; : sLocal = &quot;Text can be selected, copied, ...&quot;
+ Case &quot;DLGTRACE_TXTTRACELOG_TEXT&quot; : sLocal = &quot;--- Log file is empty ---&quot;
+ Case &quot;DLGTRACE_CMDCANCEL_HELP&quot; : sLocal = &quot;Cancel and close the dialog&quot;
+ Case &quot;DLGTRACE_CMDCANCEL_LABEL&quot; : sLocal = &quot;Cancel&quot;
+ Case &quot;DLGTRACE_LBLCLEAR_HELP&quot; : sLocal = &quot;Clear the list&quot;
+ Case &quot;DLGTRACE_LBLCLEAR_LABEL&quot; : sLocal = &quot;Clear the list&quot;
+ Case &quot;DLGTRACE_LBLMINLEVEL_HELP&quot; : sLocal = &quot;Register only logging requests above given level&quot;
+ Case &quot;DLGTRACE_LBLMINLEVEL_LABEL&quot; : sLocal = &quot;Set minimal trace level&quot;
+ Case &quot;DLGTRACE_CMDOK_HELP&quot; : sLocal = &quot;Validate&quot;
+ Case &quot;DLGTRACE_CMDOK_LABEL&quot; : sLocal = &quot;OK&quot;
+ Case &quot;DLGTRACE_CMDDUMP_HELP&quot; : sLocal = &quot;Choose a file and dump the actual list content in it&quot;
+ Case &quot;DLGTRACE_CMDDUMP_LABEL&quot; : sLocal = &quot;Dump to file&quot;
+ Case &quot;DLGTRACE_LBLNBENTRIES_HELP&quot; : sLocal = &quot;Actual size of list&quot;
+ Case &quot;DLGTRACE_LBLNBENTRIES_LABEL&quot; : sLocal = &quot;Actual number of entries:&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;DLGFORMAT_HELP&quot; : sLocal = &quot;Export the form&quot;
+ Case &quot;DLGFORMAT_TITLE&quot; : sLocal = &quot;OutputTo&quot;
+ Case &quot;DLGFORMAT_LBLFORMAT_HELP&quot; : sLocal = &quot;Format in which the form should be exported&quot;
+ Case &quot;DLGFORMAT_LBLFORMAT_LABEL&quot; : sLocal = &quot;Select the output format&quot;
+ Case &quot;DLGFORMAT_CMDOK_HELP&quot; : sLocal = &quot;Validate your choice&quot;
+ Case &quot;DLGFORMAT_CMDOK_LABEL&quot; : sLocal = &quot;OK&quot;
+ Case &quot;DLGFORMAT_CMDCANCEL_HELP&quot; : sLocal = &quot;Cancel and close the dialog&quot;
+ Case &quot;DLGFORMAT_CMDCANCEL_LABEL&quot; : sLocal = &quot;Cancel&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case Else : sLocal = &quot;&quot;
+ End Select
+ Case &quot;FR&quot;
+ Select Case UCase(psShortlabel)
+ Case &quot;ERR&quot; &amp; ERRNOTDATABASE : sLocal = &quot;Le document actuellement ouvert n&apos;est pas un document OpenOffice/LibreOffice de type Database&quot;
+ Case &quot;ERR&quot; &amp; ERRDBNOTCONNECTED : sLocal = &quot;La connexion à la banque de données n&apos;est pas établie&quot;
+ Case &quot;ERR&quot; &amp; ERRMISSINGARGUMENTS : sLocal = &quot;Des arguments sont manquants ou non initialisés&quot;
+ Case &quot;ERR&quot; &amp; ERRWRONGARGUMENT : sLocal = &quot;L&apos;argument n° %0 [Valeur = &apos;%1&apos;] n&apos;est pas valable&quot;
+ Case &quot;ERR&quot; &amp; ERRMAINFORM : sLocal = &quot;Le document &apos;%0&apos; ne contient pas exactement un formulaire principal (soit il n&apos;en a aucun soit &gt; 1)&quot;
+ Case &quot;ERR&quot; &amp; ERRSTANDALONE : sLocal = &quot;La propriété ou la méthode ne peut pas être invoquée depuis un formulaire (Writer) autonome&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTIDENTIFIED : sLocal = &quot;Le formulaire &apos;%0&apos; n&apos;a pas pu être identifié parmi l&apos;ensemble des formulaires de la Database&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTFOUND : sLocal = &quot;Formulaire &apos;%0&apos; non trouvé&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMNOTOPEN : sLocal = &quot;Le formulaire &apos;%0&apos; n&apos;est actuellement pas ouvert&quot;
+ Case &quot;ERR&quot; &amp; ERRDFUNCTION : sLocal = &quot;L&apos;exécution de la &quot;&quot;fonction database&quot;&quot; a échoué, SQL=%0&quot;
+ Case &quot;ERR&quot; &amp; ERROPENFORM : sLocal = &quot;Le formulaire &apos;%0&apos; n&apos;a pas pu être ouvert&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTY : sLocal = &quot;La propriété &apos;%0&apos; n&apos;est pas applicable dans ce contexte&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYVALUE : sLocal = &quot;La valeur &apos;%0&apos; est invalide pour la propriété &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRINDEXVALUE : sLocal = &quot;Indice invalide ou dimension erronée du tableau pour la propriété &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRCOLLECTION : sLocal = &quot;Indice de tableau invalide&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYNOTARRAY : sLocal = &quot;L&apos;argument n°%0 doit être un tableau&quot;
+ Case &quot;ERR&quot; &amp; ERRCONTROLNOTFOUND : sLocal = &quot;Contrôle &apos;%0&apos; non trouvé dans le parent (formulaire ou contrôle de table) &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRNOACTIVEFORM : sLocal = &quot;Pas de formulaire ou de contrôle actif&quot;
+ Case &quot;ERR&quot; &amp; ERRDATABASEFORM : sLocal = &quot;Le formulaire &apos;%0&apos; n&apos;a pas de données sous-jacentes&quot;
+ Case &quot;ERR&quot; &amp; ERRFOCUSINGRID : sLocal = &quot;Contrôle &apos;%0&apos; non trouvé dans le contrôle de table &apos;%1&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRNOGRIDINFORM : sLocal = &quot;Aucun contrôle de table trouvé dans le formulaire &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRFINDRECORD : sLocal = &quot;FindNext() doit être précédé par un appel réussi à FindRecord(...)&quot;
+ Case &quot;ERR&quot; &amp; ERRSQLSTATEMENT : sLocal = &quot;Erreur SQL, instruction SQL = &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERROBJECTNOTFOUND : sLocal = &quot;%0 &apos;%1&apos; non trouvé(e)&quot;
+ Case &quot;ERR&quot; &amp; ERROPENOBJECT : sLocal = &quot;%0 &apos;%1&apos;: ouverture en échec&quot;
+ Case &quot;ERR&quot; &amp; ERRCLOSEOBJECT : sLocal = &quot;%0 &apos;%1&apos;: fermeture en échec&quot;
+ Case &quot;ERR&quot; &amp; ERRMETHOD : sLocal = &quot;Méthode non applicable dans ce contexte&quot;
+ Case &quot;ERR&quot; &amp; ERRACTION : sLocal = &quot;Action non applicable dans ce contexte&quot;
+ Case &quot;ERR&quot; &amp; ERRSENDMAIL : sLocal = &quot;Le service de messagerie n&apos;a pas pu être activé&quot;
+ Case &quot;ERR&quot; &amp; ERRFORMYETOPEN : sLocal = &quot;Le formulaire %0 est déjà ouvert&quot;
+ Case &quot;ERR&quot; &amp; ERRMETHOD : sLocal = &quot;La méthode &apos;%0&apos; n&apos;est pas applicable dans ce contexte&quot;
+ Case &quot;ERR&quot; &amp; ERRPROPERTYINIT : sLocal = &quot;Propriété &apos;%0&apos; applicable mais non initialisée&quot;
+ Case &quot;ERR&quot; &amp; ERRFILENOTCREATED : sLocal = &quot;Erreur de création du fichier &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGNOTFOUND : sLocal = &quot;Dialogue &apos;%0&apos; introuvable dans les librairies chargées actuellement&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGUNDEFINED : sLocal = &quot;Boîte de dialogue inconnue&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGSTARTED : sLocal = &quot;Dialogue déjà initialisé précédemment&quot;
+ Case &quot;ERR&quot; &amp; ERRDIALOGNOTSTARTED : sLocal = &quot;Dialogue &apos;%0&apos; non initialisé&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETNODATA : sLocal = &quot;Recordset n&apos;a pas fourni de données. Toute action sur les enregistrements est rejetée&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETCLOSED : sLocal = &quot;Recordset a été clôturé. Action sur l&apos;enregistrement courant est rejetée&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETRANGE : sLocal = &quot;L&apos;enregistrement courant est hors cadre&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETFORWARD : sLocal = &quot;Action rejetée car recordset lisible seulement vers l&apos;avant ou n&apos;acceptant pas de signets&quot;
+ Case &quot;ERR&quot; &amp; ERRFIELDNULL : sLocal = &quot;Champ nul ou vide. Action rejetée&quot;
+ Case &quot;ERR&quot; &amp; ERRFILEACCESS : sLocal = &quot;Erreur d&apos;accès au fichier &apos;%0&apos;&quot;
+ Case &quot;ERR&quot; &amp; ERRMEMOLENGTH : sLocal = &quot;La longueur du champ (%0) dépasse la taille maximale autorisée.. Remplacer par WriteAllText&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTACTIONQUERY : sLocal = &quot;La requête &apos;%0&apos; n&apos;est pas une requête d&apos;action&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTUPDATABLE : sLocal = &quot;Ce recordset ou ce champ ne peut pas être mis à jour&quot;
+ Case &quot;ERR&quot; &amp; ERRUPDATESEQUENCE : sLocal = &quot;Erreur de séquence lors de la mise à jour d&apos;un Recordset&quot;
+ Case &quot;ERR&quot; &amp; ERRNOTNULLABLE : sLocal = &quot;Le champ &apos;%0&apos; ne peut pas recevoir une valeur NULLe&quot;
+ Case &quot;ERR&quot; &amp; ERRROWDELETED : sLocal = &quot;L&apos;enregistrement courant a été effacé&quot;
+ Case &quot;ERR&quot; &amp; ERRRECORDSETCLONE : sLocal = &quot;Le clonage d&apos;un Recordset cloné est interdit&quot;
+ Case &quot;ERR&quot; &amp; ERRQUERYDEFDELETED : sLocal = &quot;Le query existant &apos;%0&apos; a été supprimé&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;TABLE&quot; : sLocal = &quot;Table&quot;
+ Case &quot;QUERY&quot; : slocal = &quot;Requête&quot;
+ Case &quot;FORM&quot; : sLocal = &quot;Formulaire&quot;
+ Case &quot;REPORT&quot; : sLocal = &quot;Rapport&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;ERR#&quot; : sLocal = &quot;L&apos;erreur #&quot;
+ Case &quot;ERROCCUR&quot; : sLocal = &quot;s&apos;est produite&quot;
+ Case &quot;ERRLINE&quot; : sLocal = &quot;à la ligne&quot;
+ Case &quot;ERRIN&quot; : sLocal = &quot;dans&quot;
+ Case &quot;CALLTO&quot; : sLocal = &quot;un appel à la fonction&quot;
+ Case &quot;SAVECONSOLE&quot; : sLocal = &quot;Sauver console&quot;
+ Case &quot;SAVECONSOLEENTRIES&quot; : sLocal = &quot;Les entrées de la console ont été sauvées avec succès.&quot;
+ Case &quot;QUITSHORT&quot; : sLocal = &quot;Quitter&quot;
+ Case &quot;QUIT&quot; : sLocal = &quot;Voulez-vous réellement quitter l&apos;application ? Les données modifiées seront sauvées.&quot;
+ Case &quot;ENTERING&quot; : sLocal = &quot;Entrée dans&quot;
+ Case &quot;EXITING&quot; : sLocal = &quot;Sortie de&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;DLGTRACE_HELP&quot; : sLocal = &quot;Gestion du tampon de la console et toutes ses entrées&quot;
+ Case &quot;DLGTRACE_TITLE&quot; : sLocal = &quot;Console&quot;
+ Case &quot;DLGTRACE_LBLENTRIES_HELP&quot; : sLocal = &quot;Effacer la liste et redimensionner le tampon circulaire&quot;
+ Case &quot;DLGTRACE_LBLENTRIES_LABEL&quot; : sLocal = &quot;Définir le nombre maximum d&apos;entrées&quot;
+ Case &quot;DLGTRACE_TXTTRACELOG_HELP&quot; : sLocal = &quot;Le texte peut être sélectionné, copié, ...&quot;
+ Case &quot;DLGTRACE_TXTTRACELOG_TEXT&quot; : sLocal = &quot;--- Le fichier journal est vide ---&quot;
+ Case &quot;DLGTRACE_CMDCANCEL_HELP&quot; : sLocal = &quot;Annuler et fermer la boîte de dialogue&quot;
+ Case &quot;DLGTRACE_CMDCANCEL_LABEL&quot; : sLocal = &quot;Annuler&quot;
+ Case &quot;DLGTRACE_LBLCLEAR_HELP&quot; : sLocal = &quot;Effacer la liste&quot;
+ Case &quot;DLGTRACE_LBLCLEAR_LABEL&quot; : sLocal = &quot;Effacer la liste&quot;
+ Case &quot;DLGTRACE_LBLMINLEVEL_HELP&quot; : sLocal = &quot;N&apos;enregistrer que les demandes de journalisation à partir du niveau indiqué&quot;
+ Case &quot;DLGTRACE_LBLMINLEVEL_LABEL&quot; : sLocal = &quot;Définir le niveau minimal d&apos;enregistrement&quot;
+ Case &quot;DLGTRACE_CMDOK_HELP&quot; : sLocal = &quot;Valider&quot;
+ Case &quot;DLGTRACE_CMDOK_LABEL&quot; : sLocal = &quot;OK&quot;
+ Case &quot;DLGTRACE_CMDDUMP_HELP&quot; : sLocal = &quot;Sélectionner un fichier et y vider le contenu actuel des traces enregistrées&quot;
+ Case &quot;DLGTRACE_CMDDUMP_LABEL&quot; : sLocal = &quot;Vider dans fichier&quot;
+ Case &quot;DLGTRACE_LBLNBENTRIES_HELP&quot; : sLocal = &quot;Taille actuelle de la liste&quot;
+ Case &quot;DLGTRACE_LBLNBENTRIES_LABEL&quot; : sLocal = &quot;Nombre actuel d&apos;entrées:&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case &quot;DLGFORMAT_HELP&quot; : sLocal = &quot;Exporter le formulaire&quot;
+ Case &quot;DLGFORMAT_TITLE&quot; : sLocal = &quot;OutputTo&quot;
+ Case &quot;DLGFORMAT_LBLFORMAT_HELP&quot; : sLocal = &quot;Format dans lequel le formulaire sera exporté&quot;
+ Case &quot;DLGFORMAT_LBLFORMAT_LABEL&quot; : sLocal = &quot;Selectionner le format de sortie&quot;
+ Case &quot;DLGFORMAT_CMDOK_HELP&quot; : sLocal = &quot;Valider votre choix&quot;
+ Case &quot;DLGFORMAT_CMDOK_LABEL&quot; : sLocal = &quot;OK&quot;
+ Case &quot;DLGFORMAT_CMDCANCEL_HELP&quot; : sLocal = &quot;Annuler et fermer la boîte de dialogue&quot;
+ Case &quot;DLGFORMAT_CMDCANCEL_LABEL&quot; : sLocal = &quot;Annuler&quot;
+ &apos;----------------------------------------------------------------------------------------------------------------------
+ Case Else : sLocal = _Getlabel(psShortLabel, &quot;DEFAULT&quot;)
+ End Select
+REM *******************************************************************************************************************************************
+REM *** ***
+REM *** ANY OTHER LANGUAGE TO BE INSERTED HERE ***
+REM *** ***
+REM *******************************************************************************************************************************************
+ Case Else
+ sLocal = _Getlabel(psShortLabel, &quot;DEFAULT&quot;)
+ End Select
+
+Exit_Function:
+ _Getlabel = sLocal
+ Exit Function
+Error_Function:
+ sLocal = psShortLabel
+ GoTo Exit_Function
+End Function &apos; GetLabel V0.8.9
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _GetLabelArray(ByVal pvShortlabel As Variant, Optional ByVal psLocale As String) As Variant
+&apos; Return the localized label corresponding with the ShortLabel array of strings
+
+ If IsMissing(psLocale) Then psLocale = UCase(Left(_GetLocale(), 2)) Else psLocale = UCase(psLocale)
+ On Local Error Goto Error_Function
+
+Dim vLocal() As Variant, i As integer
+ vLocal = Array()
+
+ If Not IsArray(pvShortLabel) Then
+ vLocal = _GetLabel(pvShortLabel, psLocale)
+ Goto Exit_Function
+ End If
+
+ ReDim vLocal(LBound(pvShortLabel) To UBound(pvShortlabel))
+ For i = LBound(pvShortLabel) To UBound(pvShortlabel)
+ vLocal(i) = _GetLabel(pvShortLabel(i), psLocale)
+ Next i
+
+Exit_Function:
+ _GetlabelArray = vLocal()
+ Exit Function
+Error_Function:
+ vLocal = Array()
+ GoTo Exit_Function
+End Function &apos; GetLabelArray V0.8.9
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _GetLocale() as String
+&apos;Return OO localization
+&apos;Derived from Tools library
+
+Dim oLocale as Object
+ oLocale = _GetRegistryKeyContent(&quot;org.openoffice.Setup/L10N&quot;)
+ _GetLocale = oLocale.getByName(&quot;ooLocale&quot;)
+End Function &apos; GetLocale V0.8.9
+
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Methods.xba b/wizards/source/access2base/Methods.xba
new file mode 100644
index 000000000000..ac274c8261d0
--- /dev/null
+++ b/wizards/source/access2base/Methods.xba
@@ -0,0 +1,268 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Methods" script:language="StarBasic">Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function AddItem(Optional pvBox As Variant, ByVal Optional pvItem As Variant, ByVal Optional pvIndex) As Boolean
+&apos; Add an item in a Listbox
+
+ Utils._SetCalledSub(&quot;AddItem&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If IsMissing(pvBox) Or IsMissing(pvItem) Then Call _TraceArguments()
+ If IsMissing(pvIndex) Then pvIndex = -1
+ If Not Utils._CheckArgument(pvBox, 1, Array(CTLLISTBOX, CTLCOMBOBOX)) Then Goto Exit_Function
+
+ AddItem = pvBox.AddItem(pvItem, pvIndex)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;AddItem&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;AddItem&quot;, Erl)
+ AddItem = False
+ GoTo Exit_Function
+End Function &apos; AddItem V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(Optional pvObject As Variant, ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if pvObject has a valid property called pvProperty (case-insensitive comparison !)
+
+Dim vPropertiesList As Variant
+
+ Utils._SetCalledSub(&quot;hasProperty&quot;)
+ If IsMissing(pvObject) Or IsMissing(pvProperty) Then Call _TraceArguments()
+
+ hasProperty = False
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJCOLLECTION, OBJFORM, OBJSUBFORM, OBJCONTROL, OBJOPTIONGROUP, OBJEVENT _
+ , OBJPROPERTY, OBJDATABASE, OBJQUERYDEF, OBJTABLEDEF, OBJRECORDSET _
+ )) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvProperty, 2, vbString) Then Goto Exit_Function
+
+ hasProperty = pvObject.hasProperty(pvProperty)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;hasProperty&quot;)
+ Exit Function
+End Function &apos; hasProperty V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Move(Optional pvObject As Object _
+ , ByVal Optional pvLeft As Variant _
+ , ByVal Optional pvTop As Variant _
+ , ByVal Optional pvWidth As Variant _
+ , ByVal Optional pvHeight As Variant _
+ ) As Variant
+&apos; Execute Move method
+ Utils._SetCalledSub(&quot;Move&quot;)
+ If IsMissing(pvObject) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Move = False
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
+ If IsMissing(pvLeft) Then Call _TraceArguments()
+ If IsMissing(pvTop) Then pvTop = -1
+ If IsMissing(pvWidth) Then pvWidth = -1
+ If IsMissing(pvHeight) Then pvHeight = -1
+
+ Move = pvObject.Move(pvLeft, pvTop, pvWidth, pvHeight)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Move&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Move&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Move V.0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenHelpFile()
+&apos; Open the help file from the Help menu (IDE only)
+Const cstHelpFile = &quot;http://www.access2base.com/access2base.html&quot;
+
+ On Local Error Resume Next
+ Call _ShellExecute(cstHelpFile)
+
+End Function &apos; OpenHelpFile V0.8.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(Optional pvObject As Variant, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperties As Variant, oCounter As Variant, opProperty As Variant
+Dim vPropertiesList() As Variant
+
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments()
+ Utils._SetCalledSub(&quot;Properties&quot;)
+
+ Set vProperties = Nothing
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJCOLLECTION, OBJFORM, OBJSUBFORM, OBJCONTROL, OBJOPTIONGROUP, OBJEVENT _
+ , OBJPROPERTY, OBJDATABASE, OBJQUERYDEF, OBJTABLEDEF, OBJRECORDSET _
+ )) Then Goto Exit_Function
+
+ If IsMissing(pvIndex) Then vProperties = pvObject.Properties Else vProperties = pvObject.Properties(pvIndex)
+
+Exit_Function:
+ Set Properties = vProperties
+ Utils._ResetCalledSub(&quot;Properties&quot;)
+ Exit Function
+End Function &apos; Properties V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Refresh(Optional pvObject As Variant) As Boolean
+&apos; Refresh data with its most recent value in the database in a form or subform
+ Utils._SetCalledSub(&quot;Refresh&quot;)
+ If IsMissing(pvObject) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Refresh = False
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+
+ Refresh = pvObject.Refresh()
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Refresh&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Refresh&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Refresh V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function RemoveItem(Optional pvBox As Variant,ByVal Optional pvIndex) As Boolean
+&apos; Remove an item from a Listbox
+&apos; Index may be a string value or an index-position
+
+ Utils._SetCalledSub(&quot;RemoveItem&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If IsMissing(pvBox) Or IsMissing(pvIndex) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvBox, 1, Array(CTLLISTBOX, CTLCOMBOBOX)) Then Goto Exit_Function
+
+ RemoveItem = pvBox.RemoveItem(pvIndex)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;RemoveItem&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;RemoveItem&quot;, Erl)
+ RemoveItem = False
+ GoTo Exit_Function
+End Function &apos; RemoveItem V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Requery(Optional pvObject As Variant) As Boolean
+&apos; Refresh data displayed in a form, subform, combobox or listbox
+ Utils._SetCalledSub(&quot;Requery&quot;)
+ If IsMissing(pvObject) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJCONTROL, OBJSUBFORM)) Then Goto Exit_Function
+
+ Requery = pvObject.Requery()
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Requery&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Requery&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Requery V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFocus(Optional pvObject As Variant) As Boolean
+&apos; Execute setFocus method
+ Utils._SetCalledSub(&quot;setFocus&quot;)
+ If IsMissing(pvObject) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJCONTROL)) Then Goto Exit_Function
+
+ setFocus = pvObject.setFocus()
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;setFocus&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;setFocus&quot;, Erl)
+ Goto Exit_Function
+Error_Grid:
+ TraceError(TRACEFATAL, ERRFOCUSINGRID, Utils._CalledSub(), 0, 1, Array(pvObject._Name, ocGrid._Name))
+ Goto Exit_Function
+End Function &apos; setFocus V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _OptionGroup(ByVal pvGroupName As Variant _
+ , ByVal psParentType As String _
+ , Optional pvDatabaseForm As Object _
+ , Optional pvComponent As Object _
+ ) As Variant
+&apos; Return either an error or an object of type OPTIONGROUP based on its name
+
+ If IsMissing(pvGroupName) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Set _OptionGroup = Nothing
+
+ If Not Utils._CheckArgument(pvGroupName, 1, vbString) Then Goto Exit_Function
+
+Dim ogGroup As Variant, i As Integer, j As Integer, bFound As Boolean
+Dim vOptionButtons() As Variant, sGroupName As String
+Dim lXY() As Long, iIndex() As Integer &apos; Two indexes X-Y coordinates
+Dim oView As Object
+
+ bFound = False
+ For i = 0 To pvDatabaseForm.GroupCount - 1 &apos; Does a group with the right name exist ?
+ pvDatabaseForm.getGroup(i, vOptionButtons, sGroupName)
+ If UCase(sGroupName) = UCase(Utils._Trim(pvGroupName)) Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+
+ If bFound Then
+ ogGroup = New Optiongroup
+ ogGroup._Name = sGroupName
+ ogGroup._ButtonsGroup = vOptionButtons
+ ogGroup._Count = UBound(vOptionButtons) + 1
+ ogGroup._ParentType = psParentType
+ Set ogGroup._ParentComponent = pvComponent
+
+ ReDim lXY(1, ogGroup._Count - 1)
+ ReDim iIndex(ogGroup._Count - 1)
+ For i = 0 To ogGroup._Count - 1 &apos; Find the position of each radiobutton
+ Set oView = pvComponent.CurrentController.getControl(ogGroup._ButtonsGroup(i))
+ lXY(0, i) = oView.PosSize.X
+ lXY(1, i) = oView.PosSize.Y
+ Next i
+Const cstPixels = 10 &apos; Tolerance on coordinates when drawed approximately
+ For i = 0 To ogGroup._Count - 1 &apos; Sort them on XY coordinates
+ If i = 0 Then
+ iIndex(0) = 0
+ Else
+ iIndex(i) = i
+ For j = i - 1 To 0 Step -1
+ If lXY(1, i) - lXY(1, j) &lt; - cstPixels Or ( Abs(lXY(1, i) - lXY(1, j)) &lt;= cstPixels And lXY(0, i) - lXY(0, j) &lt; - cstPixels ) Then
+ iIndex(i) = iIndex(j)
+ iIndex(j) = iIndex(j) + 1
+ End If
+ Next j
+ End If
+ Next i
+ ogGroup._ButtonsIndex = iIndex()
+
+ Set _OptionGroup = ogGroup
+
+ Else
+
+ Set _OptionGroup = Nothing
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(1, pvGroupName))
+
+ End If
+
+Exit_Function:
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err,&quot;_OptionGroup&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; _OptionGroup V0.9.0
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/OptionGroup.xba b/wizards/source/access2base/OptionGroup.xba
new file mode 100644
index 000000000000..4a4b6ae8343d
--- /dev/null
+++ b/wizards/source/access2base/OptionGroup.xba
@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="OptionGroup" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be FORM
+Private _Name As String
+Private _ParentType As String
+Private _ParentComponent As Object
+Private _ButtonsGroup() As Variant
+Private _ButtonsIndex() As Variant
+Private _Count As Long
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJOPTIONGROUP
+ _Name = &quot;&quot;
+ _ParentType = &quot;&quot;
+ _ParentComponent = Nothing
+ _ButtonsGroup = Array()
+ _ButtonsIndex = Array()
+ _Count = 0
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Count() As Variant
+ Count = _PropertyGet(&quot;Count&quot;)
+End Property &apos; Count (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Value() As Variant
+ Value = _PropertyGet(&quot;Value&quot;)
+End Property &apos; Value (get)
+
+Property Let Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
+&apos; Return a Control object with name or index = pvIndex
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;OptionGroup.Controls&quot;)
+
+Dim ocControl As Variant, iArgNr As Integer, i As Integer
+
+ Set ocControl = Nothing
+
+ If IsMissing(pvIndex) Then &apos; No argument, return Collection object
+ Set oCounter = New Collect
+ oCounter._SubType = OBJCONTROL
+ oCounter._ParentType = OBJOPTIONGROUP
+ oCounter._ParentName = _Name
+ oCounter._Count = _Count
+ Set Controls = oCounter
+ Goto Exit_Function
+ End If
+
+ If Len(_A2B_.CalledSub) &gt; 12 And Left(_A2B_.CalledSub, 12) = &quot;OptionGroup.&quot; Then iArgNr = 1 Else iArgNr = 2
+ If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
+ If pvIndex &lt; 0 Or pvIndex &gt; _Count - 1 Then Goto Trace_Error_Index
+
+ &apos; Start building the ocControl object
+ &apos; Determine exact name
+ Set ocControl = New Control
+ ocControl._ParentType = CTLPARENTISGROUP
+
+ ocControl._Shortcut = &quot;&quot;
+ For i = 0 To _Count - 1
+ If _ButtonsIndex(i) = pvIndex Then
+ Set ocControl.ControlModel = _ButtonsGroup(i)
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG : ocControl._Name = _ButtonsGroup(i).Name
+ Case Else : ocControl._Name = _Name &apos; OptionGroup and individual radio buttons share the same name
+ End Select
+ ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
+ Exit For
+ End If
+ Next i
+ ocControl._FormComponent = _ParentComponent
+ ocControl._ClassId = acRadioButton
+ Select Case _ParentType
+ Case CTLPARENTISDIALOG : Set ocControl.ControlView = _ParentComponent.getControl(ocControl._Name)
+ Case Else : Set ocControl.ControlView = _ParentComponent.CurrentController.getControl(ocControl.ControlModel)
+ End Select
+
+ ocControl._Initialize()
+ Set Controls = ocControl
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OptionGroup.Controls&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OptionGroup.Controls&quot;, Erl)
+ Set Controls = Nothing
+ GoTo Exit_Function
+End Function &apos; Controls
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;OptionGroup.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;OptionGroup.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;OptionGroup.setProperty&quot;)
+ setProperty = _PropertySet(psProperty, pvValue)
+ Utils._ResetCalledSub(&quot;OptionGroup.setProperty&quot;)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ _PropertiesList = Array(&quot;Count&quot;, &quot;Name&quot;, &quot;ObjectType&quot;, &quot;Value&quot;)
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;OptionGroup.get&quot; &amp; psProperty)
+
+&apos;Execute
+Dim oDatabase As Object, vBookmark As Variant, vEMPTY As Variant
+Dim iValue As Integer, i As Integer
+ _PropertyGet = vEMPTY
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Count&quot;)
+ _PropertyGet = _Count
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Value&quot;)
+ iValue = -1
+ For i = 0 To _Count - 1 &apos; Find the selected RadioButton
+ If _ButtonsGroup(i).State = 1 Then
+ iValue = _ButtonsIndex(i)
+ Exit For
+ End If
+ Next i
+ _PropertyGet = iValue
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OptionGroup.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OptionGroup._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+
+ Utils._SetCalledSub(&quot;OptionGroup.set&quot; &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _PropertySet = True
+
+&apos;Execute
+Dim i As Integer, iRadioIndex As Integer, oModel As Object, iArgNr As Integer
+
+ If Len(_A2B_.CalledSub) &gt; 12 And Left(_A2B_.CalledSub, 12) = &quot;OptionGroup.&quot; Then iArgNr = 1 Else iArgNr = 2
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Value&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 0 Or pvValue &gt; _Count - 1 Then Goto Trace_Error_Value
+ For i = 0 To _Count - 1
+ _ButtonsGroup(i).State = 0
+ If _ButtonsIndex(i) = pvValue Then iRadioIndex = i
+ Next i
+ _ButtonsGroup(iRadioIndex).State = 1
+ Set oModel = _ButtonsGroup(iRadioIndex)
+ If Utils._hasUNOProperty(oModel, &quot;DataField&quot;) Then
+ If Not IsNull(oModel.Datafield) And Not IsEmpty(oModel.Datafield) Then
+ If oModel.Datafield &lt;&gt; &quot;&quot; And Utils._hasUNOMethod(oModel, &quot;commit&quot;) Then oModel.commit() &apos; f.i. checkboxes have no commit method ?? [PASTIM]
+ End If
+ End If
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;OptionGroup.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;OptionGroup._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set Value(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Value&quot;, pvValue)
+End Property &apos; Value (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/PropertiesGet.xba b/wizards/source/access2base/PropertiesGet.xba
new file mode 100644
index 000000000000..12e7ed2e3574
--- /dev/null
+++ b/wizards/source/access2base/PropertiesGet.xba
@@ -0,0 +1,1148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="PropertiesGet" script:language="StarBasic">Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getAbsolutePosition(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getAbsolutePosition&quot;)
+ getAbsolutePosition = PropertiesGet._getProperty(pvObject, &quot;AbsolutePosition&quot;)
+End Function &apos; getAbsolutePosition
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getAllowAdditions(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getAllowAdditions&quot;)
+ getAllowAdditions = PropertiesGet._getProperty(pvObject, &quot;AllowAdditions&quot;)
+End Function &apos; getAllowAdditions
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getAllowDeletions(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getAllowDeletions&quot;)
+ getAllowDeletions = PropertiesGet._getProperty(pvObject, &quot;AllowDeletions&quot;)
+End Function &apos; getAllowDeletions
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getAllowEdits(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getAllowEdits&quot;)
+ getAllowEdits = PropertiesGet._getProperty(pvObject, &quot;AllowEdits&quot;)
+End Function &apos; getAllowEdits
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBackColor(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBackColor&quot;)
+ getBackColor = PropertiesGet._getProperty(pvObject, &quot;BackColor&quot;)
+End Function &apos; getBackColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBOF(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBOF&quot;)
+ getBOF = PropertiesGet._getProperty(pvObject, &quot;BOF&quot;)
+End Function &apos; getBOF
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBookmark(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBookmark&quot;)
+ getBookmark = PropertiesGet._getProperty(pvObject, &quot;Bookmark&quot;)
+End Function &apos; getBookmark
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBookmarkable(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBookmarkable&quot;)
+ getBookmarkable = PropertiesGet._getProperty(pvObject, &quot;Bookmarkable&quot;)
+End Function &apos; getBookmarkable
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBorderColor(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBorderColor&quot;)
+ getBorderColor = PropertiesGet._getProperty(pvObject, &quot;BorderColor&quot;)
+End Function &apos; getBorderColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getBorderStyle(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getBorderStyle&quot;)
+ getBorderStyle = PropertiesGet._getProperty(pvObject, &quot;BorderStyle&quot;)
+End Function &apos; getBorderStyle
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getButtonLeft(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getButtonLeft&quot;)
+ getButtonLeft = PropertiesGet._getProperty(pvObject, &quot;ButtonLeft&quot;)
+End Function &apos; getButtonLeft
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getButtonMiddle(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getButtonMiddle&quot;)
+ getButtonMiddle = PropertiesGet._getProperty(pvObject, &quot;ButtonMiddle&quot;)
+End Function &apos; getButtonMiddle
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getButtonRight(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getButtonRight&quot;)
+ getButtonRight = PropertiesGet._getProperty(pvObject, &quot;ButtonRight&quot;)
+End Function &apos; getButtonRight
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getCancel(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getCancel&quot;)
+ getCancel = PropertiesGet._getProperty(pvObject, &quot;Cancel&quot;)
+End Function &apos; getCancel
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getCaption(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getCaption&quot;)
+ getCaption = PropertiesGet._getProperty(pvObject, &quot;Caption&quot;)
+End Function &apos; getCaption
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getClickCount(Optional pvObject As Variant) As Long
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getClickCount&quot;)
+ getClickCount = PropertiesGet._getProperty(pvObject, &quot;ClickCount&quot;)
+End Function &apos; getClickCount
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getContextShortcut(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getContextShortcut&quot;)
+ getContextShortcut = PropertiesGet._getProperty(pvObject, &quot;ContextShortcut&quot;)
+End Function &apos; getContextShortcut
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getControlSource(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getControlSource&quot;)
+ getControlSource = PropertiesGet._getProperty(pvObject, &quot;ControlSource&quot;)
+End Function &apos; getControlSource
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getControlTipText(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getControlTipText&quot;)
+ getControlTipText = PropertiesGet._getProperty(pvObject, &quot;ControlTipText&quot;)
+End Function &apos; getControlTipText
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getControlType(Optional pvObject As Variant) As Integer
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getControlType&quot;)
+ getControlType = PropertiesGet._getProperty(pvObject, &quot;ControlType&quot;)
+End Function &apos; getControlType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getCount(Optional pvObject As Variant) As Integer
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getCount&quot;)
+ getCount = PropertiesGet._getProperty(pvObject, &quot;Count&quot;)
+End Function &apos; getCount
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getCurrentRecord(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getCurrentRecord&quot;)
+ getCurrentRecord = PropertiesGet._getProperty(pvObject, &quot;CurrentRecord&quot;)
+End Function &apos; getCurrentRecord
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getDataType(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getDataType&quot;)
+ getDataType = PropertiesGet._getProperty(pvObject, &quot;DataType&quot;)
+End Function &apos; getDataType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getDbType(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getDbType&quot;)
+ getDbType = PropertiesGet._getProperty(pvObject, &quot;DbType&quot;)
+End Function &apos; getDbType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getDefault(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getDefault&quot;)
+ getDefault = PropertiesGet._getProperty(pvObject, &quot;Default&quot;)
+End Function &apos; getDefault
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getDefaultValue(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getDefaultValue&quot;)
+ getDefaultValue = PropertiesGet._getProperty(pvObject, &quot;DefaultValue&quot;)
+End Function &apos; getDefaultValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getDescription(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getDescription&quot;)
+ getDescription = PropertiesGet._getProperty(pvObject, &quot;Description&quot;)
+End Function &apos; getDescription
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getEditMode(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getEditMode&quot;)
+ getEditMode = PropertiesGet._getProperty(pvObject, &quot;EditMode&quot;)
+End Function &apos; getEditMode
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getEnabled(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getEnabled&quot;)
+ getEnabled = PropertiesGet._getProperty(pvObject, &quot;Enabled&quot;)
+End Function &apos; getEnabled
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getEOF(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getEOF&quot;)
+ getEOF = PropertiesGet._getProperty(pvObject, &quot;EOF&quot;)
+End Function &apos; getEOF
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getEventName(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getEventName&quot;)
+ getEventName = PropertiesGet._getProperty(pvObject, &quot;EventName&quot;)
+End Function &apos; getEventName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getEventType(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getEventType&quot;)
+ getEventType = PropertiesGet._getProperty(pvObject, &quot;EventType&quot;)
+End Function &apos; getEventType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFieldSize(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFieldSize&quot;)
+ getFieldSize = PropertiesGet._getProperty(pvObject, &quot;FieldSize&quot;)
+End Function &apos; getFieldSize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFilter(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFilter&quot;)
+ getFilter = PropertiesGet._getProperty(pvObject, &quot;Filter&quot;)
+End Function &apos; getFilter
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFilterOn(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFilterOn&quot;)
+ getFilterOn = PropertiesGet._getProperty(pvObject, &quot;FilterOn&quot;)
+End Function &apos; getFilterOn
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFocusChangeTemporary(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFocusChangeTemporary&quot;)
+ getFocusChangeTemporary = PropertiesGet._getProperty(pvObject, &quot;FocusChangeTemporary&quot;)
+End Function &apos; getFocusChangeTemporary
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontBold(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontBold&quot;)
+ getFontBold = PropertiesGet._getProperty(pvObject, &quot;FontBold&quot;)
+End Function &apos; getFontBold
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontItalic(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontItalic&quot;)
+ getFontItalic = PropertiesGet._getProperty(pvObject, &quot;FontItalic&quot;)
+End Function &apos; getFontItalic
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontName(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontName&quot;)
+ getFontName = PropertiesGet._getProperty(pvObject, &quot;FontName&quot;)
+End Function &apos; getFontName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontSize(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontSize&quot;)
+ getFontSize = PropertiesGet._getProperty(pvObject, &quot;FontSize&quot;)
+End Function &apos; getFontSize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontUnderline(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontUnderline&quot;)
+ getFontUnderline = PropertiesGet._getProperty(pvObject, &quot;FontUnderline&quot;)
+End Function &apos; getFontUnderline
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFontWeight(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFontWeight&quot;)
+ getFontWeight = PropertiesGet._getProperty(pvObject, &quot;FontWeight&quot;)
+End Function &apos; getFontWeight
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getForm(Optional pvObject As Variant) As Variant &apos; Return Subform pseudo
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getForm&quot;)
+ getForm = PropertiesGet._getProperty(pvObject, &quot;Form&quot;)
+End Function &apos; getForm
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getFormat(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getFormat&quot;)
+ getFormat = PropertiesGet._getProperty(pvObject, &quot;Format&quot;)
+End Function &apos; getFormat
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getHeight(Optional pvObject As Variant) As Long
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getHeight&quot;)
+ getHeight = PropertiesGet._getProperty(pvObject, &quot;Height&quot;)
+End Function &apos; getHeight
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getForeColor(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getForeColor&quot;)
+ getForeColor = PropertiesGet._getProperty(pvObject, &quot;ForeColor&quot;)
+End Function &apos; getForeColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getIsLoaded(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getIsLoaded&quot;)
+ getIsLoaded = PropertiesGet._getProperty(pvObject, &quot;IsLoaded&quot;)
+End Function &apos; getIsLoaded
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getItemData(Optional pvObject As Variant, ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getItemData&quot;)
+ If IsMissing(pvIndex) Then
+ getItemData = PropertiesGet._getProperty(pvObject, &quot;ItemData&quot;)
+ Else
+ getItemData = PropertiesGet._getProperty(pvObject, &quot;ItemData&quot;, pvIndex)
+ End If
+End Function &apos; getItemData
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyAlt(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyAlt&quot;)
+ getKeyAlt = PropertiesGet._getProperty(pvObject, &quot;KeyAlt&quot;)
+End Function &apos; getKeyAlt
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyChar(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyChar&quot;)
+ getKeyChar = PropertiesGet._getProperty(pvObject, &quot;KeyChar&quot;)
+End Function &apos; getKeyChar
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyCode(Optional pvObject As Variant) As Integer
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyCode&quot;)
+ getKeyCode = PropertiesGet._getProperty(pvObject, &quot;KeyCode&quot;)
+End Function &apos; getKeyCode
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyCtrl(Optional pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyCtrl&quot;)
+ getKeyCtrl = PropertiesGet._getProperty(pvObject, &quot;KeyCtrl&quot;)
+End Function &apos; getKeyCtrl
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyFunction(Optional pvObject As Variant) As Integer
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyFunction&quot;)
+ getKeyFunction = PropertiesGet._getProperty(pvObject, &quot;KeyFunction&quot;)
+End Function &apos; getKeyFunction
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getKeyShift(pvObject As Variant) As Boolean
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getKeyShift&quot;)
+ getKeyShift = PropertiesGet._getProperty(pvObject, &quot;KeyShift&quot;)
+End Function &apos; getKeyShift
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getLinkChildFields(Optional pvObject As Variant, ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getLinkChildFields&quot;)
+ If IsMissing(pvObject) Then
+ getLinkChildFields = PropertiesGet._getProperty(pvObject, &quot;LinkChildFields&quot;)
+ Else
+ getLinkChildFields = PropertiesGet._getProperty(pvObject, &quot;LinkChildFields&quot;, pvIndex)
+ End If
+End Function &apos; getLinkChildFields
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getLinkMasterFields(Optional pvObject As Variant, ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getLinkMasterFields&quot;)
+ If IsMissing(pvIndex) Then
+ getLinkMasterFields = PropertiesGet._getProperty(pvObject, &quot;LinkMasterFields&quot;)
+ Else
+ getLinkMasterFields = PropertiesGet._getProperty(pvObject, &quot;LinkMasterFields&quot;, pvIndex)
+ End If
+End Function &apos; getLinkMasterFields
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getListCount(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getListCount&quot;)
+ getListCount = PropertiesGet._getProperty(pvObject, &quot;ListCount&quot;)
+End Function &apos; getListCount
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getListIndex(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getListIndex&quot;)
+ getListIndex = PropertiesGet._getProperty(pvObject, &quot;ListIndex&quot;)
+End Function &apos; getListIndex
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getLocked(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getLocked&quot;)
+ getLocked = PropertiesGet._getProperty(pvObject, &quot;Locked&quot;)
+End Function &apos; getLocked
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getMultiSelect(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getMultiSelect&quot;)
+ getMultiSelect = PropertiesGet._getProperty(pvObject, &quot;MultiSelect&quot;)
+End Function &apos; getMultiSelect
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getName(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getName&quot;)
+ getName = PropertiesGet._getProperty(pvObject, &quot;Name&quot;)
+End Function &apos; getName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getObject(Optional pvShortcut As Variant) As Variant
+&apos; Return the object described by pvShortcut ignoring its final property
+&apos; Example: &quot;Forms!myForm!myControl.myProperty&quot; =&gt; Controls(Forms(&quot;myForm&quot;), &quot;myControl&quot;))
+
+Const cstEXCLAMATION = &quot;!&quot;
+Const cstDOT = &quot;.&quot;
+
+ Utils._SetCalledSub(&quot;getObject&quot;)
+ If IsMissing(pvShortcut) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvShortcut, 1, vbString) Then Goto Exit_Function
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+Dim iCurrentIndex As Integer, vCurrentObject As Variant, sCurrentProperty As String
+Dim sComponents() As String, sSubComponents() As String, sDialog As String
+Dim oDatabase As Object
+ Set vCurrentObject = Nothing
+ sComponents = Split(Trim(pvShortcut), cstEXCLAMATION)
+ If UBound(sComponents) = 0 Then Goto Trace_Error
+ If Not Utils._InList(UCase(sComponents(0)), Array(&quot;FORMS&quot;, &quot;DIALOGS&quot;)) Then Goto Trace_Error
+ If sComponents(1) = &quot;0&quot; Or Left(sComponents(1), 2) = &quot;0.&quot; Then
+ oDatabase = Application._CurrentDb()
+ If oDatabase._Standalone Then sComponents(1) = oDatabase.FormName Else Goto Trace_Error
+ End If
+
+ sSubComponents = Split(sComponents(UBound(sComponents)), cstDOT)
+ sComponents(UBound(sComponents)) = sSubComponents(0) &apos; Ignore final property, if any
+
+ Set vCurrentObject = New Collect
+ Select Case UCase(sComponents(0))
+ Case &quot;FORMS&quot; : vCurrentObject._CollType = COLLFORMS
+ Case &quot;DIALOGS&quot; : vCurrentObject._CollType = COLLALLDIALOGS
+ End Select
+ For iCurrentIndex = 1 To UBound(sComponents) &apos; Start parsing ...
+ sSubComponents = Split(sComponents(iCurrentIndex), cstDOT)
+ sComponents(iCurrentIndex) = Utils._Trim(sSubComponents(0))
+ Select Case UBound(sSubComponents)
+ Case 0
+ sCurrentProperty = &quot;&quot;
+ Case 1
+ sCurrentProperty = sSubComponents(1)
+ Case Else
+ Goto Trace_Error
+ End Select
+ Select Case vCurrentObject._Type
+ Case OBJCOLLECTION
+ Select Case vCurrentObject._CollType
+ Case COLLFORMS
+ vCurrentObject = Application.Forms(sComponents(iCurrentIndex))
+ Case COLLALLDIALOGS
+ sDialog = UCase(sComponents(iCurrentIndex))
+ vCurrentObject = Application.AllDialogs(sDialog)
+ If Not vCurrentObject.IsLoaded Then Goto Trace_Error
+ Set vCurrentObject.UnoDialog = _CurrentDb.Dialogs.Item(sDialog)
+ &apos;Case Else
+ End Select
+ Case OBJFORM, OBJSUBFORM, OBJCONTROL, OBJDIALOG
+ vCurrentObject = vCurrentObject.Controls(sComponents(iCurrentIndex))
+ End Select
+ If sCurrentProperty &lt;&gt; &quot;&quot; Then vCurrentObject = PropertiesGet._getProperty(vCurrentObject, sCurrentProperty)
+ Next iCurrentIndex
+
+ Set getObject = vCurrentObject
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;getObject&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , 1)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;getObject&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; getObject V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getObjectType(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getObjectType&quot;)
+ getObjectType = PropertiesGet._getProperty(pvObject, &quot;ObjectType&quot;)
+End Function &apos; getObjectType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getOpenArgs(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getOpenArgs&quot;)
+ getOpenArgs = PropertiesGet._getProperty(pvObject, &quot;OpenArgs&quot;)
+End Function &apos; getOpenArgs
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getOptionGroup(Optional pvObject As Variant, pvName As variant) As Variant
+&apos; Return an OptionGroup object based on its name
+
+ Utils._SetCalledSub(&quot;getOptionGroup&quot;)
+ If IsMissing(pvObject) Or IsMissing(pvName) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If Not Utils._CheckArgument(pvObject, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvName, 2, vbString) Then Goto Exit_Function
+
+ getOptionGroup = pvObject.OptionGroup(pvName)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;getOptionGroup&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;getOptionGroup&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; getOptionGroup V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getOptionValue(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getOptionValue&quot;)
+ getOptionValue = PropertiesGet._getProperty(pvObject, &quot;OptionValue&quot;)
+End Function &apos; getOptionValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getPage(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getPage&quot;)
+ getPage = PropertiesGet._getProperty(pvObject, &quot;Page&quot;)
+End Function &apos; getPage V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getParent(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getParent&quot;)
+ getParent = PropertiesGet._getProperty(pvObject, &quot;Parent&quot;)
+End Function &apos; getParent V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional pvItem As Variant, Optional ByVal pvProperty As Variant, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return property value of object pvItem, and psProperty property name
+ Utils._SetCalledSub(&quot;getProperty&quot;)
+ If IsMissing(pvItem) Then Call _TraceArguments()
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ If IsMissing(pvIndex) Then getProperty = PropertiesGet._getProperty(pvItem, pvProperty) Else getProperty = PropertiesGet._getProperty(pvItem, pvProperty, pvIndex)
+ Utils._ResetCalledSub(&quot;getProperty&quot;)
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRecommendation(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRecommendation&quot;)
+ getRecommendation = PropertiesGet._getProperty(pvObject, &quot;Recommendation&quot;)
+End Function &apos; getRecommendation
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRecordCount(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRecordCount&quot;)
+ getRecordCount = PropertiesGet._getProperty(pvObject, &quot;RecordCount&quot;)
+End Function &apos; getRecordCount
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRecordset(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRecordset&quot;)
+ getRecordset = PropertiesGet._getProperty(pvObject, &quot;Recordset&quot;)
+End Function &apos; getRecordset V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRecordSource(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRecordSource&quot;)
+ getRecordSource = PropertiesGet._getProperty(pvObject, &quot;RecordSource&quot;)
+End Function &apos; getRecordSource
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRequired(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRequired&quot;)
+ getRequired = PropertiesGet._getProperty(pvObject, &quot;Required&quot;)
+End Function &apos; getRequired
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRowChangeAction(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRowChangeAction&quot;)
+ getRowChangeAction = PropertiesGet._getProperty(pvObject, &quot;RowChangeAction&quot;)
+End Function &apos; getRowChangeAction
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRowSource(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRowSource&quot;)
+ getRowSource = PropertiesGet._getProperty(pvObject, &quot;RowSource&quot;)
+End Function &apos; getRowSource
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getRowSourceType(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getRowSourceType&quot;)
+ getRowSourceType = PropertiesGet._getProperty(pvObject, &quot;RowSourceType&quot;)
+End Function &apos; getRowSourceType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSelected(Optional pvObject As Variant, ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSelected&quot;)
+ If IsMissing(pvIndex) Then
+ getSelected = PropertiesGet._getProperty(pvObject, &quot;Selected&quot;)
+ Else
+ getSelected = PropertiesGet._getProperty(pvObject, &quot;Selected&quot;, pvIndex)
+ End If
+End Function &apos; getSelected
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSize(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSize&quot;)
+ getSize = PropertiesGet._getProperty(pvObject, &quot;Size&quot;)
+End Function &apos; getSize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSource(Optional pvObject As Variant) As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSource&quot;)
+ getSource = PropertiesGet._getProperty(pvObject, &quot;Source&quot;)
+End Function &apos; getSource V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSourceField(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSourceField&quot;)
+ getSourceField = PropertiesGet._getProperty(pvObject, &quot;SourceField&quot;)
+End Function &apos; getSourceField
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSourceTable(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSourceTable&quot;)
+ getSourceTable = PropertiesGet._getProperty(pvObject, &quot;SourceTable&quot;)
+End Function &apos; getSourceTable
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSpecialEffect(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSpecialEffect&quot;)
+ getSpecialEffect = PropertiesGet._getProperty(pvObject, &quot;SpecialEffect&quot;)
+End Function &apos; getSpecialEffect
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSubType(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSubType&quot;)
+ getSubType = PropertiesGet._getProperty(pvObject, &quot;SubType&quot;)
+End Function &apos; getSubType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSubComponentName(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSubComponentName&quot;)
+ getSubComponentName = PropertiesGet._getProperty(pvObject, &quot;SubComponentName&quot;)
+End Function &apos; getSubComponentName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getSubComponentType(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getSubComponentType&quot;)
+ getSubComponentType = PropertiesGet._getProperty(pvObject, &quot;SubComponentType&quot;)
+End Function &apos; getSubComponentType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTabIndex(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTabIndex&quot;)
+ getTabIndex = PropertiesGet._getProperty(pvObject, &quot;TabIndex&quot;)
+End Function &apos; getTabIndex
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTabStop(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTabStop&quot;)
+ getTabStop = PropertiesGet._getProperty(pvObject, &quot;TabStop&quot;)
+End Function &apos; getTabStop
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTag(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTag&quot;)
+ getTag = PropertiesGet._getProperty(pvObject, &quot;Tag&quot;)
+End Function &apos; getTag
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getText(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getText&quot;)
+ getText = PropertiesGet._getProperty(pvObject, &quot;Text&quot;)
+End Function &apos; getText
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTextAlign(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTextAlign&quot;)
+ getTextAlign = PropertiesGet._getProperty(pvObject, &quot;TextAlign&quot;)
+End Function &apos; getTextAlign
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTripleState(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTripleState&quot;)
+ getTripleState = PropertiesGet._getProperty(pvObject, &quot;TripleState&quot;)
+End Function &apos; getTripleState
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getTypeName(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getTypeName&quot;)
+ getTypeName = PropertiesGet._getProperty(pvObject, &quot;TypeName&quot;)
+End Function &apos; getTypeName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getValue(Optional pvObject As Variant) As Variant
+&apos; getValue also interprets shortcut strings !!
+Dim vItem As Variant, sProperty As String
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getValue&quot;)
+ If VarType(pvObject) = vbString Then
+ Utils._SetCalledSub(&quot;getValue&quot;)
+ Set vItem = getObject(pvObject)
+ sProperty = Utils._FinalProperty(pvObject)
+ If sProperty = &quot;&quot; Then sProperty = &quot;Value&quot; &apos; Default value if final property in shortcut is absent
+ getValue = PropertiesGet._getProperty(vItem, sProperty)
+ Utils._ResetCalledSub(&quot;getValue&quot;)
+ Else
+ getValue = PropertiesGet._getProperty(pvObject, &quot;Value&quot;)
+ End If
+End Function &apos; getValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getVisible(Optional pvObject As Variant) As Variant
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getVisible&quot;)
+ getVisible = PropertiesGet._getProperty(pvObject, &quot;Visible&quot;)
+End Function &apos; getVisible
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getWidth(Optional pvObject As Variant) As Long
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getWdth&quot;)
+ getWidth = PropertiesGet._getProperty(pvObject, &quot;Width&quot;)
+End Function &apos; getWidth
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getXPos(Optional pvObject As Variant) As Long
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getXPos&quot;)
+ getXPos = PropertiesGet._getProperty(pvObject, &quot;XPos&quot;)
+End Function &apos; getXPos
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getYPos(Optional pvObject As Variant) As Long
+ If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;getYPos&quot;)
+ getYPos = PropertiesGet._getProperty(pvObject, &quot;YPos&quot;)
+End Function &apos; getYPos
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function _getProperty(pvItem As Variant, ByVal psProperty As String, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return property value of the psProperty property name within object pvItem
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;get&quot; &amp; psProperty)
+ _getProperty = Nothing
+
+&apos;Check Index argument
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 3, Utils._AddNumeric()) Then Goto Exit_Function
+ End If
+&apos;Execute
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AbsolutePosition&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.AbsolutePosition
+ Case UCase(&quot;AllowAdditions&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.AllowAdditions
+ Case UCase(&quot;AllowDeletions&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.AllowDeletions
+ Case UCase(&quot;AllowEdits&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.AllowEdits
+ Case UCase(&quot;BackColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.BackColor
+ Case UCase(&quot;BOF&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.BOF
+ Case UCase(&quot;Bookmark&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJRECORDSET)) Then Goto Exit_Function
+ _getProperty = pvItem.Bookmark
+ Case UCase(&quot;Bookmarkable&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.Bookmarkable
+ Case UCase(&quot;BorderColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.BorderColor
+ Case UCase(&quot;BorderStyle&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.BorderStyle
+ Case UCase(&quot;ButtonLeft&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.ButtonLeft
+ Case UCase(&quot;ButtonMiddle&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.ButtonMiddle
+ Case UCase(&quot;ButtonRight&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.ButtonRight
+ Case UCase(&quot;Cancel&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Cancel
+ Case UCase(&quot;Caption&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ _getProperty = pvItem.Caption
+ Case UCase(&quot;ClickCount&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.ClickCount
+ Case UCase(&quot;ContextShortcut&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.ContextShortcut
+ Case UCase(&quot;ControlSource&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ControlSource
+ Case UCase(&quot;ControlTipText&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ControlTipText
+ Case UCase(&quot;ControlType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ControlType
+ Case UCase(&quot;Count&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJCOLLECTION,OBJOPTIONGROUP)) Then Goto Exit_Function
+ _getProperty = pvItem.Count
+ Case UCase(&quot;CurrentRecord&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.CurrentRecord
+ Case UCase(&quot;DataType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.DataType
+ Case UCase(&quot;DbType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.DbType
+ Case UCase(&quot;Default&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Default
+ Case UCase(&quot;DefaultValue&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJCONTROL, OBJFIELD)) Then Goto Exit_Function
+ _getProperty = pvItem.DefaultValue
+ Case UCase(&quot;Description&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.Description
+ Case UCase(&quot;EditMode&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.EditMode
+ Case UCase(&quot;Enabled&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Enabled
+ Case UCase(&quot;EOF&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.EOF
+ Case UCase(&quot;EventName&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.EventName
+ Case UCase(&quot;EventType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.EventType
+ Case UCase(&quot;FieldSize&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.FieldSize
+ Case UCase(&quot;Filter&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM, OBJRECORDSET)) Then Goto Exit_Function
+ _getProperty = pvItem.Filter
+ Case UCase(&quot;FilterOn&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.FilterOn
+ Case UCase(&quot;FocusChangeTemporary&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.FocusChangeTemporary
+ Case UCase(&quot;FontBold&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontBold
+ Case UCase(&quot;FontItalic&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontItalic
+ Case UCase(&quot;FontName&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontName
+ Case UCase(&quot;FontSize&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontSize
+ Case UCase(&quot;FontUnderline&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontUnderline
+ Case UCase(&quot;FontWeight&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.FontWeight
+ Case UCase(&quot;ForeColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ForeColor
+ Case UCase(&quot;Form&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, CTLSUBFORM) Then Goto Exit_Function
+ _getProperty = pvItem.Form
+ Case UCase(&quot;Format&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Format
+ Case UCase(&quot;Height&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
+ _getProperty = pvItem.Height
+ Case UCase(&quot;IsLoaded&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFORM) Then Goto Exit_Function
+ _getProperty = pvItem.IsLoaded
+ Case UCase(&quot;ItemData&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ If IsMissing(pvIndex) Then _getProperty = pvItem.ItemData Else _getProperty = pvItem.ItemData(pvIndex)
+ Case UCase(&quot;KeyAlt&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyAlt
+ Case UCase(&quot;KeyChar&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyChar
+ Case UCase(&quot;KeyCode&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyCode
+ Case UCase(&quot;KeyCtrl&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyCtrl
+ Case UCase(&quot;KeyFunction&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyFunction
+ Case UCase(&quot;KeyShift&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.KeyShift
+ Case UCase(&quot;LinkChildFields&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJSUBFORM) Then Goto Exit_Function
+ If IsMissing(pvIndex) Then _getProperty = pvItem.LinkChildFields Else _getProperty = pvItem.LinkChildFields(pvIndex)
+ Case UCase(&quot;LinkMasterFields&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJSUBFORM) Then Goto Exit_Function
+ If IsMissing(pvIndex) Then _getProperty = pvItem.LinkMasterFields Else _getProperty = pvItem.LinkMasterFields(pvIndex)
+ Case UCase(&quot;ListCount&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ListCount
+ Case UCase(&quot;ListIndex&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.ListIndex
+ Case UCase(&quot;Locked&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ If IsNull(pvItem.Locked) Then Goto Trace_Error
+ _getProperty = pvItem.Locked
+ Case UCase(&quot;MultiSelect&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.MultiSelect
+ Case UCase(&quot;Name&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, _
+ Array(OBJFORM, OBJSUBFORM, OBJCONTROL, OBJOPTIONGROUP, OBJPROPERTY, OBJDIALOG, OBJTABLEDEF, OBJRECORDSET, OBJFIELD) _
+ ) Then Goto Exit_Function
+ _getProperty = pvItem.Name
+ Case UCase(&quot;ObjectType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJDATABASE, OBJCOLLECTION, OBJFORM, OBJDIALOG, OBJSUBFORM, OBJCONTROL _
+ , OBJEVENT, OBJOPTIONGROUP, OBJPROPERTY, OBJRECORDSET, OBJTABLEDEF, OBJFIELD) _
+ ) Then Goto Exit_Function
+ _getProperty = pvItem.ObjectType
+ Case UCase(&quot;OpenArgs&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFORM) Then Goto Exit_Function
+ _getProperty = pvItem.OpenArgs
+ Case UCase(&quot;OptionValue&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.OptionValue
+ Case UCase(&quot;Page&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ _getProperty = pvItem.Page
+ Case UCase(&quot;Parent&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJSUBFORM, OBJCONTROL)) Then Goto Exit_Function
+ _getProperty = pvItem.Parent
+ Case UCase(&quot;Recommendation&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.Recommendation
+ Case UCase(&quot;RecordCount&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ _getProperty = pvItem.RecordCount
+ Case UCase(&quot;Recordset&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.Recordset
+ Case UCase(&quot;RecordSource&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ _getProperty = pvItem.RecordSource
+ Case UCase(&quot;Required&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Required
+ Case UCase(&quot;RowChangeAction&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.RowChangeAction
+ Case UCase(&quot;RowSource&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.RowSource
+ Case UCase(&quot;RowSourceType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.RowSourceType
+ Case UCase(&quot;Selected&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ If IsMissing(pvIndex) Then _getProperty = pvItem.Selected Else _getProperty = pvItem.Selected(pvIndex)
+ Case UCase(&quot;Size&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.Size
+ Case UCase(&quot;Source&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.Source
+ Case UCase(&quot;SourceTable&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.SourceTable
+ Case UCase(&quot;SourceField&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.SourceField
+ Case UCase(&quot;SpecialEffect&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.SpecialEffect
+ Case UCase(&quot;SubComponentName&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.SubComponentName
+ Case UCase(&quot;SubComponentType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ _getProperty = pvItem.SubComponentType
+ Case UCase(&quot;SubType&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.SubType
+ Case UCase(&quot;TabIndex&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.TabIndex
+ Case UCase(&quot;TabStop&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.TabStop
+ Case UCase(&quot;Tag&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Tag
+ Case UCase(&quot;Text&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.Text
+ Case UCase(&quot;TextAlign&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.TextAlign
+ Case UCase(&quot;TripleState&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ _getProperty = pvItem.TripleState
+ Case UCase(&quot;TypeName&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
+ _getProperty = pvItem.TypeName
+ Case UCase(&quot;Value&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJCONTROL, OBJOPTIONGROUP, OBJPROPERTY, OBJFIELD)) Then Goto Exit_Function
+ _getProperty = pvItem.Value
+ Case UCase(&quot;Visible&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ _getProperty = pvItem.Visible
+ Case UCase(&quot;Width&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
+ _getProperty = pvItem.Width
+ Case UCase(&quot;XPos&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ If IsNull(pvItem.XPos) Then Goto Trace_Error
+ _getProperty = pvItem.XPos
+ Case UCase(&quot;YPos&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
+ If IsNull(pvItem.YPos) Then Goto Trace_Error
+ _getProperty = pvItem.YPos
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _getProperty = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _getProperty = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;_getProperty&quot;, Erl)
+ _getProperty = Nothing
+ GoTo Exit_Function
+End Function &apos; _getProperty V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _hasProperty(ByVal psObject As String, ByVal pvPropertiesList() As Variant, ByVal pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+&apos; Generic hasProperty function called from all class modules
+
+Dim sObject As String
+ sObject = Utils._PCase(psObject)
+ Utils._SetCalledSub(sObject &amp; &quot;.hasProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+
+ _hasProperty = False
+ If Not Utils._CheckArgument(pvProperty, 1, vbString) Then Goto Exit_Function
+
+ _hasProperty = Utils._InList(pvProperty, pvPropertiesList(), , True)
+
+Exit_Function:
+ Utils._ResetCalledSub(sObject &amp; &quot;.hasProperty&quot;)
+ Exit Function
+End Function &apos; _hasProperty
+
+REM ------------------------------------------------------------------------------------------------------------------------
+Public Function _ParentObject(psShortcut As String) As Object
+&apos; Return parent object from shortcut as a string
+
+Dim sParent As String, vParent() As Variant, iBound As Integer
+ vParent = Split(psShortcut, &quot;!&quot;)
+ iBound = UBound(vParent) - 1
+ ReDim Preserve vParent(0 To iBound) &apos; Remove last element
+ sParent = Join(vParent, &quot;!&quot;)
+
+ &apos;Remove &quot;.Form&quot; if present
+Const cstForm = &quot;.FORM&quot;
+ Set _ParentObject = Nothing
+ If Len(sParent) &gt; Len(cstForm) Then
+ If UCase(Right(sParent, Len(cstForm))) = cstForm Then
+ Set _ParentObject = getValue(sParent)
+ Else
+ Set _ParentObject = getObject(sParent)
+ End If
+ End If
+
+End Function &apos; _ParentObject V0.9.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _Properties(ByVal psObject As String _
+ , ByVal psObjectName As String _
+ , ByVal pvPropertiesList() As Variant _
+ , ByVal Optional pvIndex As Variant _
+ ) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+&apos; Generic function called from Properties methods stored in classes
+
+Dim vProperties As Variant, oCounter As Object, opProperty As Object
+Dim iArgNr As Integer, iLen As Integer
+
+ Utils._SetCalledSub(psObject &amp; &quot;.Properties&quot;)
+
+ vProperties = Null
+
+ If IsMissing(pvIndex) Then &apos; Call without index argument prepares a Collection object
+ Set oCounter = New Collect
+ oCounter._CollType = COLLPROPERTIES
+ oCounter._ParentType = UCase(psObject)
+ oCounter._ParentName = psObjectName
+ oCounter._Count = UBound(pvPropertiesList) + 1
+ Set vProperties = oCounter
+ Else
+ iLen = Len(psObject) + 1
+ If Len(_A2B_.CalledSub) &gt; iLen Then
+ If Left(_A2B_.CalledSub, iLen) = psObject &amp; &quot;.&quot; Then iArgNr = 1 Else iArgNr = 2
+ End If
+ If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
+ If pvIndex &lt; LBound(pvPropertiesList) Or pvIndex &gt; UBound(pvPropertiesList) Then
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Else
+ Set opProperty = New Property
+ opProperty._Name = pvPropertiesList(pvIndex)
+ opProperty._Value = Null
+ Set vProperties = opProperty
+ End If
+ End If
+
+Exit_Function:
+ Set _Properties = vProperties
+ Utils._ResetCalledSub(psObject &amp; &quot;.Properties&quot;)
+ Exit Function
+End Function &apos; _Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _PropertiesList(pvObject As Variant) As Variant
+&apos; Return an array of strings containing the list of valid properties of pvObject
+
+Dim vProperties As Variant
+Dim vPropertiesList As Variant, bPropertiesList() As Boolean, sPropertiesList() As String
+Dim i As Integer, j As Integer, iCount As Integer
+
+ Set vProperties = Nothing
+ Select Case pvObject._Type
+ Case OBJCOLLECTION, OBJPROPERTY, OBJFORM, OBJEVENT, OBJSUBFORM, OBJCONTROL, OBJOPTIONGROUP _
+ , OBJDATABASE, OBJTABLEDEF, OBJQUERYDEF, OBJDIALOG, OBJFIELD, OBJRECORDSET
+ vPropertiesList = pvObject._PropertiesList()
+ Case Else
+ End Select
+
+Exit_Function:
+ Set _PropertiesList = vPropertiesList
+ Exit Function
+End Function &apos; PropertiesList V0.9.0
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/PropertiesSet.xba b/wizards/source/access2base/PropertiesSet.xba
new file mode 100644
index 000000000000..8f9a7b2e7eda
--- /dev/null
+++ b/wizards/source/access2base/PropertiesSet.xba
@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="PropertiesSet" script:language="StarBasic">Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setAbsolutePosition(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setAbsolutePosition&quot;)
+ setAbsolutePosition = PropertiesSet._setProperty(pvObject, &quot;AbsolutePosition&quot;, pvValue)
+End Function &apos; setAbsolutePosition
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setAllowAdditions(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setAllowAdditions&quot;)
+ setAllowAdditions = PropertiesSet._setProperty(pvObject, &quot;AllowAdditions&quot;, pvValue)
+End Function &apos; setAllowAdditions
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setAllowDeletions(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setAllowDeletions&quot;)
+ setAllowDeletions = PropertiesSet._setProperty(pvObject, &quot;AllowDeletions&quot;, pvValue)
+End Function &apos; setAllowDeletions
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setAllowEdits(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setAllowEdits&quot;)
+ setAllowEdits = PropertiesSet._setProperty(pvObject, &quot;AllowEdits&quot;, pvValue)
+End Function &apos; setAllowEdits
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setBackColor(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setBackColor&quot;)
+ setBackColor = PropertiesSet._setProperty(pvObject, &quot;BackColor&quot;, pvValue)
+End Function &apos; setBackColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setBookmark(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setBookmark&quot;)
+ setBookmark = PropertiesSet._setProperty(pvObject, &quot;Bookmark&quot;, pvValue)
+End Function &apos; setBookmark
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setBorderColor (Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setBorderColor&quot;)
+ setBorderColor = PropertiesSet._setProperty(pvObject, &quot;BorderColor&quot;, pvValue)
+End Function &apos; setBorderColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setBorderStyle(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setBorderStyle&quot;)
+ setBorderStyle = PropertiesSet._setProperty(pvObject, &quot;BorderStyle&quot;, pvValue)
+End Function &apos; setBorderStyle
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setCancel(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setCancel&quot;)
+ setCancel = PropertiesSet._setProperty(pvObject, &quot;Cancel&quot;, pvValue)
+End Function &apos; setCancel
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setCaption(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setCaption&quot;)
+ setCaption = PropertiesSet._setProperty(pvObject, &quot;Caption&quot;, pvValue)
+End Function &apos; setCaption
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setControlTipText(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setControlTipText&quot;)
+ setControlTipText = PropertiesSet._setProperty(pvObject, &quot;ControlTipText&quot;, pvValue)
+End Function &apos; setControlTipText
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setCurrentRecord(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setCurrentRecord&quot;)
+ setCurrentRecord = PropertiesSet._setProperty(pvObject, &quot;CurrentRecord&quot;, pvValue)
+End Function &apos; setCurrentRecord
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setDefault(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setDefault&quot;)
+ setDefault = PropertiesSet._setProperty(pvObject, &quot;Default&quot;, pvValue)
+End Function &apos; setDefault
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setDefaultValue(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setDefaultValue&quot;)
+ setDefaultValue = PropertiesSet._setProperty(pvObject, &quot;DefaultValue&quot;, pvValue)
+End Function &apos; setDefaultValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setEnabled(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setEnabled&quot;)
+ setEnabled = PropertiesSet._setProperty(pvObject, &quot;Enabled&quot;, pvValue)
+End Function &apos; setEnabled
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFilter(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFilter&quot;)
+ setFilter = PropertiesSet._setProperty(pvObject, &quot;Filter&quot;, pvValue)
+End Function &apos; setFilter
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFilterOn(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFilterOn&quot;)
+ setFilterOn = PropertiesSet._setProperty(pvObject, &quot;FilterOn&quot;, pvValue)
+End Function &apos; setFilterOn
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontBold(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontBold&quot;)
+ setFontBold = PropertiesSet._setProperty(pvObject, &quot;FontBold&quot;, pvValue)
+End Function &apos; setFontBold
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontItalic(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontItalic&quot;)
+ setFontItalic = PropertiesSet._setProperty(pvObject, &quot;FontItalic&quot;, pvValue)
+End Function &apos; setFontItalic
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontName(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontName&quot;)
+ setFontName = PropertiesSet._setProperty(pvObject, &quot;FontName&quot;, pvValue)
+End Function &apos; setFontName
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontSize(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontSize&quot;)
+ setFontSize = PropertiesSet._setProperty(pvObject, &quot;FontSize&quot;, pvValue)
+End Function &apos; setFontSize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontUnderline(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontUnderline&quot;)
+ setFontUnderline = PropertiesSet._setProperty(pvObject, &quot;FontUnderline&quot;, pvValue)
+End Function &apos; setFontUnderline
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setFontWeight(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setFontWeight&quot;)
+ setFontWeight = PropertiesSet._setProperty(pvObject, &quot;FontWeight&quot;, pvValue)
+End Function &apos; setFontWeight
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setForeColor(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setForeColor&quot;)
+ setForeColor = PropertiesSet._setProperty(pvObject, &quot;ForeColor&quot;, pvValue)
+End Function &apos; setForeColor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setHeight(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setHeight&quot;)
+ setHeight = PropertiesSet._setProperty(pvObject, &quot;Height&quot;, pvValue)
+End Function &apos; setHeight
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setListIndex(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setListIndex&quot;)
+ setListIndex = PropertiesSet._setProperty(pvObject, &quot;ListIndex&quot;, pvValue)
+End Function &apos; setListIndex
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setLocked(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setLocked&quot;)
+ setLocked = PropertiesSet._setProperty(pvObject, &quot;Locked&quot;, pvValue)
+End Function &apos; setLocked
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setMultiSelect(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setMultiSelect&quot;)
+ setMultiSelect = PropertiesSet._setProperty(pvObject, &quot;MultiSelect&quot;, pvValue)
+End Function &apos; setMultiSelect
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setOptionValue(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setOptionValue&quot;)
+ setOptionValue = PropertiesSet._setProperty(pvObject, &quot;OptionValue&quot;, pvValue)
+End Function &apos; setOptionValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setPage(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setPage&quot;)
+ setPage = PropertiesSet._setProperty(pvObject, &quot;Page&quot;, pvValue)
+End Function &apos; setPage V0.9.1
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(Optional pvItem As Variant, ByVal Optional psProperty As String, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;setProperty&quot;)
+ If IsMissing(pvItem) Or IsMissing(psProperty) Or IsMissing(pvValue) Or IsEmpty(pvItem) Then Call _TraceArguments()
+ If IsMissing(pvIndex) Then
+ setProperty = PropertiesSet._setProperty(pvItem, psProperty, pvValue)
+ Else
+ setProperty = PropertiesSet._setProperty(pvItem, psProperty, pvValue, pvIndex)
+ End If
+ Utils._ResetCalledSub(&quot;setProperty&quot;)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setRecordSource(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setRecordSource&quot;)
+ setRecordSource = PropertiesSet._setProperty(pvObject, &quot;RecordSource&quot;, pvValue)
+End Function &apos; setRecordSource
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setRequired(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setRequired&quot;)
+ setRequired = PropertiesSet._setProperty(pvObject, &quot;Required&quot;, pvValue)
+End Function &apos; setRequired
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setRowSource(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setRowSource&quot;)
+ setRowSource = PropertiesSet._setProperty(pvObject, &quot;RowSource&quot;, pvValue)
+End Function &apos; setRowSource
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setRowSourceType(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setRowSourceType&quot;)
+ setRowSourceType = PropertiesSet._setProperty(pvObject, &quot;RowSourceType&quot;, pvValue)
+End Function &apos; setRowSourceType
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setSelected(Optional pvObject As Variant, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Then Call _TraceArguments(&quot;setSelected&quot;)
+ If IsEmpty(pvObject) Then Call _TraceArguments(&quot;setSelected&quot;)
+ If IsMissing(pvIndex) Then
+ setSelected = PropertiesSet._setProperty(pvObject, &quot;Selected&quot;, pvValue)
+ Else
+ setSelected = PropertiesSet._setProperty(pvObject, &quot;Selected&quot;, pvValue, pvIndex)
+ End If
+End Function &apos; setSelected
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setSpecialEffect(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setSpecialEffect&quot;)
+ setSpecialEffect = PropertiesSet._setProperty(pvObject, &quot;SpecialEffect&quot;, pvValue)
+End Function &apos; setSpecialEffect
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setTabIndex(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setTabIndex&quot;)
+ setTabIndex = PropertiesSet._setProperty(pvObject, &quot;TabIndex&quot;, pvValue)
+End Function &apos; setTabIndex
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setTabStop(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setTabStop&quot;)
+ setTabStop = PropertiesSet._setProperty(pvObject, &quot;TabStop&quot;, pvValue)
+End Function &apos; setTabStop
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setTag(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setTag&quot;)
+ setTag = PropertiesSet._setProperty(pvObject, &quot;Tag&quot;, pvValue)
+End Function &apos; setTag
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setTextAlign(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setTextAlign&quot;)
+ setTextAlign = PropertiesSet._setProperty(pvObject, &quot;TextAlign&quot;, pvValue)
+End Function &apos; setTextAlign
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setTripleState(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setTripleState&quot;)
+ setTripleState = PropertiesSet._setProperty(pvObject, &quot;TripleState&quot;, pvValue)
+End Function &apos; setTripleState
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setValue(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; setValue also interprets shortcut strings !!
+Dim vItem As Variant, sProperty As String
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setValue&quot;)
+ If VarType(pvObject) = vbString Then
+ Utils._SetCalledSub(&quot;setValue&quot;)
+ vItem = getObject(pvObject)
+ sProperty = Utils._FinalProperty(pvObject)
+ If sProperty = &quot;&quot; Then sProperty = &quot;Value&quot;
+ setValue = PropertiesSet._setProperty(vItem, sProperty, pvValue)
+ Utils._ResetCalledSub(&quot;setValue&quot;)
+ Else
+ setValue = PropertiesSet._setProperty(pvObject, &quot;Value&quot;, pvValue)
+ End If
+End Function &apos; setValue
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setVisible(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms and controls
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setVisible&quot;)
+ setVisible = PropertiesSet._setProperty(pvObject, &quot;Visible&quot;, pvValue)
+End Function &apos; setVisible
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setWidth(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
+&apos; Only for open forms
+ If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments(&quot;setWidth&quot;)
+ setWidth = PropertiesSet._setProperty(pvObject, &quot;Width&quot;, pvValue)
+End Function &apos; setWidth
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private Function _CheckProperty(pvObject As Object, ByVal psProperty As String) As Boolean
+&apos; Return False if psProperty not within the PropertyValues set of pvItem
+
+Dim i As Integer, oPropertyValues As Variant, oProperty As Variant
+ oPropertyValues = pvObject.PropertyValues
+
+ For i = LBound(oPropertyValues) To UBound(oPropertyValues)
+ oProperty = oPropertyValues(i)
+ If UCase(oProperty.Name) = UCase(psProperty) Then
+ _CheckProperty = True
+ Exit Function
+ End If
+ Next i
+
+ _CheckProperty = False
+ Exit Function
+
+End Function &apos; CheckProperty V0.7.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _setProperty(pvItem As Variant, ByVal psProperty As String, ByVal pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;set&quot; &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+&apos;Check Index argument
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 4, Utils._AddNumeric()) Then Goto Exit_Function
+ End If
+&apos;Execute
+Dim iArgNr As Integer, lFormat As Long
+Dim i As Integer, iCount As Integer, iSelectedItems() As Integer, bListboxBound As Boolean
+Dim odbDatabase As Object, vNames As Variant, bFound As Boolean, sName As String, oModel As Object
+Dim ocButton As Variant, iRadioIndex As Integer
+ _setProperty = True
+ If _A2B_.CalledSub = &quot;setProperty&quot; Then iArgNr = 3 Else iArgNr = 2
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AbsolutePosition&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
+ pvItem.AbsolutePosition = pvValue
+ Case UCase(&quot;AllowAdditions&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.AllowAdditions = pvValue
+ Case UCase(&quot;AllowDeletions&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.AllowDeletions = pvValue
+ Case UCase(&quot;AllowEdits&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.AllowEdits = pvValue
+ Case UCase(&quot;BackColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.BackColor = pvValue
+ Case UCase(&quot;Bookmark&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJRECORDSET)) Then Goto Exit_Function
+ pvItem.Bookmark = pvValue
+ Case UCase(&quot;BorderColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.BorderColor = pvValue
+ Case UCase(&quot;BorderStyle&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.BorderColor = pvValue
+ Case UCase(&quot;Cancel&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Cancel = pvValue
+ Case UCase(&quot;Caption&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ pvItem.Caption = pvValue
+ Case UCase(&quot;ControlTipText&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.ControlTipText = pvValue
+ Case UCase(&quot;CurrentRecord&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.CurrentRecord = pvValue
+ Case UCase(&quot;Default&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Default = pvValue
+ Case UCase(&quot;DefaultValue&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.DefaultValue = pvValue
+ Case UCase(&quot;Enabled&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Enabled = pvValue
+ Case UCase(&quot;Filter&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM, OBJRECORDSET)) Then Goto Exit_Function
+ pvItem.Filter = pvValue
+ Case UCase(&quot;FilterOn&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.FilterOn = pvValue
+ Case UCase(&quot;FontBold&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontBold = pvValue
+ Case UCase(&quot;FontItalic&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontItalic = pvValue
+ Case UCase(&quot;FontName&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontName = pvValue
+ Case UCase(&quot;FontSize&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontSize = pvValue
+ Case UCase(&quot;FontUnderline&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontUnderline = pvValue
+ Case UCase(&quot;FontWeight&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.FontWeight = pvValue
+ Case UCase(&quot;ForeColor&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.ForeColor = pvValue
+ Case UCase(&quot;Height&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
+ pvItem.Height = pvValue
+ Case UCase(&quot;ListIndex&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.ListIndex = pvValue
+ Case UCase(&quot;Locked&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Locked = pvValue
+ Case UCase(&quot;MultiSelect&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.MultiSelect = pvValue
+ Case UCase(&quot;OptionValue&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.OptionValue = pvValue
+ Case UCase(&quot;Page&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ pvItem.Page = pvValue
+ Case UCase(&quot;RecordSource&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
+ pvItem.RecordSource = pvValue
+ Case UCase(&quot;Required&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Required = pvValue
+ Case UCase(&quot;RowSource&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.RowSource = pvValue
+ Case UCase(&quot;RowSourceType&quot;) &apos; Refresh done when RowSource changes, not RowSourceType
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.RowSourceType = pvValue
+ Case UCase(&quot;Selected&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ If IsMissing(pvIndex) Then pvItem.Selected = pvValue Else pvItem.SelectedI(pvValue, pvIndex)
+ Case UCase(&quot;SpecialEffect&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.SpecialEffect = pvValue
+ Case UCase(&quot;TabIndex&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.TabIndex = pvValue
+ Case UCase(&quot;TabStop&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.TabStop = pvValue
+ Case UCase(&quot;Tag&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.Tag = pvValue
+ Case UCase(&quot;TextAlign&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.TextAlign = pvValue
+ Case UCase(&quot;TripleState&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
+ pvItem.TripleState = pvValue
+ Case UCase(&quot;Value&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJCONTROL, OBJOPTIONGROUP, OBJFIELD)) Then Goto Exit_Function
+ pvItem.Value = pvValue
+ Case UCase(&quot;Visible&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
+ pvItem.Visible = pvValue
+ Case UCase(&quot;Width&quot;)
+ If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
+ pvItem.Width = pvValue
+ Case Else
+ Goto Trace_Error_Control
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error_Form:
+ TraceError(TRACEFATAL, ERRFORMNOTFOUND, Utils._CalledSub(), 0, 1, pvItem._Name)
+ _setProperty = False
+ Goto Exit_Function
+Trace_Error_Control:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _setProperty = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _setProperty = False
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _setProperty = Nothing
+ Goto Exit_Function
+Trace_Error_Array:
+ TraceError(TRACEFATAL, ERRPROPERTYNOTARRAY, Utils._CalledSub(), 0, 1, iArgNr)
+ _setProperty = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;_setProperty&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; _setProperty V0.9.1
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Property.xba b/wizards/source/access2base/Property.xba
new file mode 100644
index 000000000000..7d59ef7bd304
--- /dev/null
+++ b/wizards/source/access2base/Property.xba
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Property" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be PROPERTY
+Private _Name As String
+Private _Value As Variant
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJPROPERTY
+ _Name = &quot;&quot;
+ _Value = Null
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Value() As Variant
+ Value = _PropertyGet(&quot;Value&quot;)
+End Property &apos; Value (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;Property.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;Property.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+ _PropertiesList = Array(&quot;Name&quot;, &quot;ObjectType&quot;, &quot;Value&quot;)
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;Property.get&quot; &amp; psProperty)
+ _PropertyGet = Nothing
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Value&quot;)
+ _PropertyGet = _Value
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;Property.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;Property._PropertyGet&quot;, Erl)
+ _PropertyGet = Nothing
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Recordset.xba b/wizards/source/access2base/Recordset.xba
new file mode 100644
index 000000000000..ae6c4d2576df
--- /dev/null
+++ b/wizards/source/access2base/Recordset.xba
@@ -0,0 +1,1053 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Recordset" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be RECORDSET
+Private _Name As String &apos; Unique, generated
+Private _ParentName As String
+Private _ParentType As String
+Private _ForwardOnly As Boolean
+Private _PassThrough As Boolean
+Private _ReadOnly As Boolean
+Private _CommandType As Long
+Private _Command As String
+Private _DataSet As Boolean &apos; True if execute() successful
+Private _BOF As Boolean
+Private _EOF As Boolean
+Private _Filter As String
+Private _EditMode As Integer &apos; dbEditxxx constants
+Private _BookmarkBeforeNew As Variant
+Private _BookmarkLastModified As Variant
+Private _IsClone As Boolean
+Private RowSet As Object &apos; com.sun.star.comp.dba.ORowSet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJRECORDSET
+ _Name = &quot;&quot;
+ _ParentName = &quot;&quot;
+ _ParentType = &quot;&quot;
+ _ForwardOnly = False
+ _PassThrough = False
+ _ReadOnly = False
+ _CommandType = 0
+ _Command = &quot;&quot;
+ _DataSet = False
+ _BOF = True
+ _EOF = True
+ _Filter = &quot;&quot;
+ _EditMode = dbEditNone
+ _BookmarkBeforeNew = Null
+ _BookmarkLastModified = Null
+ _IsClone = False
+ Set RowSet = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Terminate()
+ mClose()
+ Set Statement = Nothing
+ Set RowSet = Nothing
+End Sub
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AbsolutePosition() As Variant
+ AbsolutePosition = _PropertyGet(&quot;AbsolutePosition&quot;)
+End Property &apos; AbsolutePosition (get)
+
+Property Let AbsolutePosition(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AbsolutePosition&quot;, pvValue)
+End Property &apos; AbsolutePosition (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get BOF() As Boolean
+ BOF = _PropertyGet(&quot;BOF&quot;)
+End Property &apos; BOF (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Bookmark() As Variant
+ Bookmark = _PropertyGet(&quot;Bookmark&quot;)
+End Property &apos; Bookmark (get)
+
+Property Let Bookmark(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Bookmark&quot;, pvValue)
+End Property &apos; Bookmark (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Bookmarkable() As Boolean
+ Bookmarkable = _PropertyGet(&quot;Bookmarkable&quot;)
+End Property &apos; Bookmarkable (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get EOF() As Boolean
+ EOF = _PropertyGet(&quot;EOF&quot;)
+End Property &apos; EOF (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get EditMode() As Boolean
+ EditMode = _PropertyGet(&quot;EditMode&quot;)
+End Property &apos; EditMode (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Filter() As Variant
+ Filter = _PropertyGet(&quot;Filter&quot;)
+End Property &apos; Filter (get)
+
+Property Let Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get LastModified() As Variant
+&apos; DO NOT PUBLISH
+ LastModified = _PropertyGet(&quot;LastModified&quot;)
+End Property &apos; LastModified (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RecordCount() As Long
+ RecordCount = _PropertyGet(&quot;RecordCount&quot;)
+End Property &apos; RecordCount (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function AddNew() As Boolean
+&apos; Initiates the creation of a new record
+
+Const cstThisSub = &quot;Recordset.AddNew&quot;
+Dim i As Integer, iFieldsCount As Integer, oField As Object
+Dim sdefault As String, oColumn As Object
+Dim iValue As Integer, lValue As Long, sgValue As Single, dbValue As Double, dValue As Date
+Dim vTemp As Variant
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ AddNew = False
+
+ With RowSet
+ &apos;Is inserting a new row allowed ?
+ If _ForwardOnly Or _ReadOnly Then Goto Error_NoUpdate
+ If Not .CanUpdateInsertedRows Then Goto Error_NoUpdate
+ If Not .IsBookmarkable Then Goto Error_NoUpdate
+ If _EditMode &lt;&gt; dbEditNone Then CancelUpdate()
+ If _BOF And _EOF Then &apos; Records before first or after last do not have a bookmark
+ _BookmarkBeforeNew = &quot;_BOF_&quot;
+ ElseIf .isBeforeFirst() Then
+ _BookmarkBeforeNew = &quot;_BOF_&quot;
+ ElseIf .isAfterLast() Then
+ _BookmarkBeforeNew = &quot;_EOF_&quot;
+ Else
+ _BookmarkBeforeNew = .getBookmark()
+ End If
+
+ .moveToInsertRow()
+
+ &apos;Set all fields to their default value
+ iFieldsCount = Fields().Count
+ On Local Error Resume Next &apos; Do not stop if default setting fails
+ For i = 0 To iFieldsCount - 1
+ Set oField = Fields(i)
+ Set oColumn = oField.Column
+ If Utils._hasUNOProperty(oColumn, &quot;DefaultValue&quot;) Then &apos; Default value in database set via SQL statement
+ sDefault = oColumn.DefaultValue
+ ElseIf Utils._hasUNOProperty(oColumn, &quot;ControlDefault&quot;) Then &apos; Default value set in Base via table edition
+ If IsEmpty(oColumn.ControlDefault) Then sdefault = &quot;&quot; Else sDefault = oColumn.ControlDefault
+ Else
+ sdefault = &quot;&quot;
+ End If
+ If sDefault = &quot;&quot; Then
+ If oColumn.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE Then oColumn.updateNull()
+ Else &apos; No default value
+ With com.sun.star.sdbc.DataType
+ Select Case oColumn.Type
+ Case .BIT, .BOOLEAN
+ If sDefault = &quot;1&quot; Then oColumn.updateBoolean(True) Else oColumn.updateBoolean(False)
+ Case .TINYINT
+ iValue = CInt(sDefault)
+ If iValue &gt;= -128 And iValue &lt;= +127 Then oColumn.updateShort(iValue)
+ Case .SMALLINT
+ lValue = CLng(sDefault)
+ If lValue &gt;= -32768 And lValue &lt;= 32767 Then oColumn.updateInt(lValue)
+ Case .INTEGER
+ lValue = CLng(sDefault)
+ If lValue &gt;= -2147483648 And lValue &lt;= 2147483647 Then oColumn.updateInt(lValue)
+ Case .BIGINT
+ lValue = CLng(sDefault)
+ Column.updateLong(lValue) &apos; No proper type conversion for HYPER data type
+ Case .FLOAT
+ sgValue = CSng(sDefault)
+ If Abs(sgValue) &lt; 3.402823E38 And Abs(sgValue) &gt; 1.401298E-45 Then oColumn.updateFloat(sgValue)
+ Case .REAL, .DOUBLE
+ dbValue = CDbl(sDefault)
+ &apos;If Abs(dbValue) &lt; 1.79769313486232E308 And Abs(dbValue) &gt; 4.94065645841247E-307 Then oColumn.updateDouble(dbValue)
+ oColumn.updateDouble(dbValue)
+ Case .NUMERIC, .DECIMAL
+ dbValue = CDbl(sDefault)
+ If Utils._hasUNOProperty(Column, &quot;Scale&quot;) Then
+ If Column.Scale &gt; 0 Then
+ &apos;If Abs(dbValue) &lt; 1.79769313486232E308 And Abs(dbValue) &gt; 4.94065645841247E-307 Then oColumn.updateDouble(dbValue)
+ oColumn.updateDouble(dbValue)
+ Else
+ oColumn.updateString(sdefault)
+ End If
+ Else
+ oColumn.updateString(sdefault)
+ End If
+ Case .CHAR, .VARCHAR, .LONGVARCHAR
+ oColumn.updateString(sdefault) &apos; vbString
+ Case .DATE
+ dValue = DateValue(sDefault)
+ vTemp = New com.sun.star.util.Date
+ With vTemp
+ .Day = Day(dValue)
+ .Month = Month(dValue)
+ .Year = Year(dValue)
+ End With
+ oColumn.updateDate(vTemp)
+ Case .TIME
+ dValue = TimeValue(sDefault)
+ vTemp = New com.sun.star.util.Time
+ With vTemp
+ .Hours = Hour(dValue)
+ .Minutes = Minute(dValue)
+ .Seconds = Second(dValue)
+ &apos;.HundredthSeconds = 0
+ End With
+ oColumn.updateTime(vTemp)
+ Case .TIMESTAMP
+ dValue = DateValue(sDefault)
+ vTemp = New com.sun.star.util.DateTime
+ With vTemp
+ .Day = Day(dValue)
+ .Month = Month(dValue)
+ .Year = Year(dValue)
+ .Hours = Hour(dValue)
+ .Minutes = Minute(dValue)
+ .Seconds = Second(dValue)
+ &apos;.HundredthSeconds = 0
+ End With
+ oColumn.updateTimestamp(vTemp)
+&apos; Case .BINARY, .VARBINARY, .LONGVARBINARY
+ &apos; Case .BLOB
+&apos; Case .CLOB
+ Case Else
+ End Select
+ End With
+ End If
+ Next i
+ End With
+ On Local Error Goto Error_Function
+
+ _EditMode = dbEditAdd
+ AddNew = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_NoUpdate:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; AddNew
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function CancelUpdate() As Boolean
+&apos; Cancel any edit action
+
+Const cstThisSub = &quot;Recordset.CancelUpdate&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ CancelUpdate = False
+
+ With RowSet
+ Select Case _EditMode
+ Case dbEditNone
+ Case dbEditAdd
+ If Not IsNull(_BookmarkBeforeNew) Then
+ Select Case _BookmarkBeforeNew
+ Case &quot;_BOF_&quot; : .beforeFirst()
+ Case &quot;_EOF_&quot; : .afterLast()
+ Case Else : .moveToBookmark(_BookmarkBeforeNew)
+ End Select
+ End If
+ Case dbEditInProgress
+ .cancelRowUpdates()
+ End Select
+ End With
+
+ _EditMode = dbEditNone
+ _BookmarkBeforeNew = Null
+ _BookmarkLastModified = Null
+ CancelUpdate = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function &apos; CancelUpdate
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Clone() As Object
+&apos; Duplicate an existing recordset
+
+Const cstThisSub = &quot;Recordset.Clone&quot;
+
+Const cstNull = -1
+Dim iType As Integer, iOptions As Integer, iLockEdit As Integer
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ Set Clone = Nothing
+
+ If _IsClone Then Goto Error_Clone
+ If _ForwardOnly Then iType = dbOpenForwardOnly Else iType = cstNull
+ If _PassThrough Then iOptions = dbSQLPassThrough Else iOptions = cstNull
+ iLockEdit = dbReadOnly &apos; Always read-only
+
+ Set Clone = OpenRecordset(iType, iOptions, iLockEdit, True)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_Clone:
+ TraceError(TRACEFATAL, ERRRECORDSETCLONE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Clone
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function mClose(ByVal Optional pbRemove As Boolean) As Variant
+&apos; Dispose UNO objects
+&apos; If pbRemove = True, remove recordset from Recordsets collection
+
+Const cstThisSub = &quot;Recordset.Close&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Exit_Function &apos; Do not stop execution
+ Utils._SetCalledSub(cstThisSub)
+ If Not IsNull(RowSet) Then
+ RowSet.close()
+ RowSet.dispose()
+ End If
+ _ForwardOnly = False
+ _PassThrough = False
+ _ReadOnly = False
+ _CommandType = 0
+ _Command = &quot;&quot;
+ _DataSet = False
+ _BOF = True
+ _EOF = True
+ _Filter = &quot;&quot;
+ _EditMode = dbEditNone
+ _BookmarkBeforeNew = Null
+ _BookmarkLastModified = Null
+ _IsClone = False
+ Set RowSet = Nothing
+ If IsMissing(pbRemove) Then pbRemove = True
+ If pbRemove Then Application.CurrentDb().RecordsetsColl.Remove(_Name)
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; Close
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Delete() As Boolean
+&apos; Deletes the current record
+
+Const cstThisSub = &quot;Recordset.Delete&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ Delete = False
+
+ &apos;Is deleting a row allowed ?
+ If _ForwardOnly Or _ReadOnly Then Goto Error_NoUpdate
+ If _EditMode &lt;&gt; dbEditNone Then
+ CancelUpdate()
+ Goto Error_Sequence
+ End If
+ If RowSet.rowDeleted() Then Goto Error_RowDeleted
+
+ RowSet.deleteRow()
+ Delete = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_NoUpdate:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_RowDeleted:
+ TraceError(TRACEFATAL, ERRROWDELETED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Sequence:
+ TraceError(TRACEFATAL, ERRUPDATESEQUENCE, Utils._CalledSub(), 0, 1)
+ Goto Exit_Function
+End Function &apos; Delete
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Edit() As Boolean
+&apos; Updates the current record
+
+Const cstThisSub = &quot;Recordset.Edit&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ Edit = False
+
+ &apos;Is updating a row allowed ?
+ If _ForwardOnly Or _ReadOnly Then Goto Error_NoUpdate
+ If _EditMode &lt;&gt; dbEditNone Then CancelUpdate()
+ If RowSet.rowDeleted() Then Goto Error_RowDeleted
+
+ _EditMode = dbEditInProgress
+ Edit = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_NoUpdate:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_RowDeleted:
+ TraceError(TRACEFATAL, ERRROWDELETED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Edit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Fields(ByVal Optional pvIndex As variant) As Object
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Const cstThisSub = &quot;Recordset.Fields&quot;
+ Utils._SetCalledSub(cstThisSub)
+
+ Set Fields = Nothing
+ If Not IsMissing(pvIndex) Then
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+ End If
+
+Dim sObjects() As String, sObjectName As String, oObject As Object
+Dim i As Integer, bFound As Boolean, oFields As Object
+
+ Set oFields = RowSet.getColumns()
+ sObjects = oFields.ElementNames()
+ Select Case True
+ Case IsMissing(pvIndex)
+ Set oObject = New Collect
+ oObject._CollType = COLLFIELDS
+ oObject._ParentType = OBJRECORDSET
+ oObject._ParentName = _Name
+ oObject._Count = UBound(sObjects) + 1
+ Goto Exit_Function
+ Case VarType(pvIndex) = vbString
+ bFound = False
+ &apos; Check existence of object and find its exact (case-sensitive) name
+ For i = 0 To UBound(sObjects)
+ If UCase(pvIndex) = UCase(sObjects(i)) Then
+ sObjectName = sObjects(i)
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If Not bFound Then Goto Trace_NotFound
+ Case Else &apos; pvIndex is numeric
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(sObjects) Then Goto Trace_IndexError
+ sObjectName = sObjects(pvIndex)
+ End Select
+
+ Set oObject = New Field
+ oObject._Name = sObjectName
+ Set oObject.Column = oFields.getByName(sObjectName)
+ oObject._ParentName = _Name
+ oObject._ParentType = _Type
+
+Exit_Function:
+ Set Fields = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERROBJECTNOTFOUND, Utils._CalledSub(), 0, , Array(&quot;Field&quot;, pvIndex))
+ Goto Exit_Function
+Trace_IndexError:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Fields
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+Const cstThisSub = &quot;Recordset.getProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+Const cstThisSub = &quot;Recordset.hasProperty&quot;
+ Utils._SetCalledSub(cstThisSub)
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Move(ByVal Optional pvRelative As Variant, ByVal Optional pvBookmark As variant) As Boolean
+&apos; Move record pointer Relative rows vs. bookmark or current record
+
+ If IsMissing(pvRelative) Then Call _TraceArguments()
+ If Not Utils._CheckArgument(pvRelative, 1, Utils._AddNumeric()) Then Goto Exit_Function
+
+ If IsMissing(pvBookmark) Then Move = _Move(pvRelative) Else Move = _Move(pvRelative, pvBookmark)
+
+Exit_Function:
+ Exit Function
+End Function &apos; Move
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function MoveFirst() As Boolean
+ MoveFirst = _Move(&quot;First&quot;)
+End Function &apos; MoveFirst
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function MoveLast() As Boolean
+ MoveLast = _Move(&quot;Last&quot;)
+End Function &apos; MoveLast
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function MoveNext() As Boolean
+ MoveNext = _Move(&quot;Next&quot;)
+End Function &apos; MoveNext
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function MovePrevious() As Boolean
+ MovePrevious = _Move(&quot;Previous&quot;)
+End Function &apos; MovePrevious
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OpenRecordset(ByVal Optional pvType As Variant _
+ , ByVal Optional pvOptions As Variant _
+ , ByVal Optional pvLockEdit As Variant _
+ , ByVal Optional pbClone As Boolean) As Object
+&apos;Return a Recordset object based on currentrecordset object with filter addition
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = Utils._PCase(_Type) &amp; &quot;.OpenRecordset&quot;
+ Utils._SetCalledSub(cstThisSub)
+ Set OpenRecordset = Nothing
+Const cstNull = -1
+
+Dim oObject As Object, odbDatabase As Object
+ Set oObject = Nothing
+ If IsMissing(pvType) Then
+ pvType = cstNull
+ Else
+ If Not Utils._CheckArgument(pvType, 1, Utils._AddNumeric(), Array(cstNull, dbOpenForwardOnly)) Then Goto Exit_Function
+ End If
+ If IsMissing(pvOptions) Then
+ pvOptions = cstNull
+ Else
+ If Not Utils._CheckArgument(pvOptions, 2, Utils._AddNumeric(), Array(cstNull, dbSQLPassThrough)) Then Goto Exit_Function
+ End If
+ If IsMissing(pvLockEdit) Then
+ pvLockEdit = cstNull
+ Else
+ If Not Utils._CheckArgument(pvLockEdit, 3, Utils._AddNumeric(), Array(cstNull, dbReadOnly)) Then Goto Exit_Function
+ End If
+ If IsMissing(pbClone) Then pbClone = False &apos; pbClone is a not published argument
+
+ Set oObject = New Recordset
+ With oObject
+ ._CommandType = _CommandType
+ ._Command = _Command
+ ._ParentName = _Name
+ ._ParentType = _Type
+ ._ForwardOnly = ( pvType = dbOpenForwardOnly )
+ ._PassThrough = ( pvOptions = dbSQLPassThrough )
+ ._ReadOnly = ( pvLockEdit = dbReadOnly )
+ Select Case True
+ Case pbClone : Call ._Initialize(, RowSet)
+ Case _Filter &lt;&gt; &quot;&quot; : Call ._Initialize(_Filter)
+ Case Else : Call ._Initialize()
+ End Select
+ End With
+ Set odbDatabase = Application._CurrentDb()
+ With odbDatabase
+ .RecordsetMax = .RecordsetMax + 1
+ oObject._Name = Format(.RecordsetMax, &quot;0000000&quot;)
+ .RecordsetsColl.Add(oObject, UCase(oObject._Name))
+ End With
+
+ If Not ( oObject._BOF And oObject._EOF ) Then oObject.MoveFirst() &apos; Do nothing if resultset empty
+
+Exit_Function:
+ Set OpenRecordset = oObject
+ Set oObject = Nothing
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, Utils._CalledSub(), Erl)
+ GoTo Exit_Function
+End Function &apos; OpenRecordset
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Const cstThisSub = &quot;Recordset.Properties&quot;
+ Utils._SetCalledSub(cstThisSub)
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Update() As Boolean
+&apos; Finalize the updates of the current record
+
+Const cstThisSub = &quot;Recordset.Update&quot;
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(cstThisSub)
+ Update = False
+
+ &apos;Is updating a row allowed ?
+ If _ForwardOnly Or _ReadOnly Then Goto Error_NoUpdate
+ With RowSet
+ If .rowDeleted() Then Goto Error_RowDeleted
+ Select Case _EditMode
+ Case dbEditNone
+ Goto Trace_Error_Update
+ Case dbEditAdd
+ If .IsNew And .IsModified Then .insertRow()
+ _BookmarkLastModified = .getBookmark()
+ If Not IsNull(_BookmarkBeforeNew) Then
+ Select Case _BookmarkBeforeNew
+ Case &quot;_BOF_&quot; : .beforeFirst()
+ Case &quot;_EOF_&quot; : .afterLast()
+ Case Else : .moveToBookmark(_BookmarkBeforeNew)
+ End Select
+ End If
+ Case dbEditInProgress
+ If .IsModified Then
+ .updateRow()
+ _BookmarkLastModified = .getBookmark()
+ End If
+ End Select
+ End With
+ _EditMode = dbEditNone
+ Update = True
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+Error_NoUpdate:
+ TraceError(TRACEFATAL, ERRNOTUPDATABLE, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Trace_Error_Update:
+ TraceError(TRACEFATAL, ERRUPDATESEQUENCE, Utils._CalledSub(), 0, 1)
+ Goto Exit_Function
+Error_RowDeleted:
+ TraceError(TRACEFATAL, ERRROWDELETED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+End Function &apos; Update
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub _Initialize(ByVal Optional pvFilter As Variant, Optional poRowSet As Object)
+&apos; Initialize new recordset
+
+ If _Command = &quot;&quot; Then Exit Sub
+
+ If _ErrorHandler() Then On Local Error Goto Error_Sub
+ If IsMissing(pvFilter) Then pvFilter = &quot;&quot;
+ If Not IsMissing(poRowSet) Then &apos; Clone
+ Set RowSet = poRowSet.createResultSet()
+ _IsClone = True
+ RowSet.last() &apos; Solves bookmark desynchro when parent bookmark is used ?!?
+ Else
+ Set RowSet = CreateUnoService(&quot;com.sun.star.sdb.RowSet&quot;)
+ _IsClone = False
+ With RowSet
+ If IsNull(.ActiveConnection) Then Set .ActiveConnection = Application._CurrentDb().Connection &apos; Error forced if connection broken
+ .CommandType = _CommandType
+ .Command = _Command
+ If _ForwardOnly Then .ResultSetType = com.sun.star.sdbc.ResultSetType.FORWARD_ONLY _
+ Else .ResultSetType = com.sun.star.sdbc.ResultSetType.SCROLL_SENSITIVE
+ If _PassThrough Then .EscapeProcessing = False _
+ Else .EscapeProcessing = True
+ If _ReadOnly Then
+ .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY
+ .TransactionIsolation = com.sun.star.sdbc.TransactionIsolation.READ_UNCOMMITTED &apos; Dirty read
+ Else
+ .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.UPDATABLE
+ .TransactionIsolation = com.sun.star.sdbc.TransactionIsolation.READ_COMMITTED
+ End If
+ End With
+
+ If Not IsMissing(pvFilter) Then &apos; Filter must be set before execute()
+ If pvFilter &lt;&gt; &quot;&quot; Then
+ RowSet.Filter = pvFilter
+ RowSet.ApplyFilter = True
+ End If
+ End If
+ On Local Error Goto SQL_Error
+ RowSet.execute()
+ On Local Error Goto Error_Sub
+ End If
+ _DataSet = True
+&apos;If the Recordset contains no records, the BOF and EOF properties are True, and there is no current record.
+ _BOF = ( RowSet.IsRowCountFinal And RowSet.RowCount = 0 )
+ _EOF = _BOF
+
+Exit_Sub:
+ Exit Sub
+SQL_Error:
+ TraceError(TRACEFATAL, ERRSQLSTATEMENT, Utils._CalledSub(), 0, , _Command)
+ Goto Exit_Sub
+Error_Sub:
+ TraceError(TRACEABORT, Err, &quot;Recordset._Initialize&quot;, Erl)
+ GoTo Exit_Sub
+End Sub &apos; _Initialize
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function _Move(pvTarget As Variant, ByVal Optional pvBookmark As Variant, ByVal Optional pbAbsolute As Boolean) As Boolean
+&apos;Move to the first, last, next, or previous record in a specified Recordset object and make that record the current record.
+
+Dim cstThisSub As String
+ cstThisSub = &quot;Recordset.Move&quot; &amp; Iif(VarType(pvTarget) = vbString, pvTarget, &quot;&quot;)
+ Utils._SetCalledSub(cstThisSub)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ If IsNull(RowSet) Then Goto Trace_Closed
+ If Not _DataSet Then Goto Trace_NoData
+ If _BOF And _EOF Then Goto Trace_NoData
+ _Move = False
+ CancelUpdate() &apos; Any Move cancels all updates, even Move(0) !
+
+Dim l As Long, lRow As Long
+ With RowSet
+ Select Case VarType(pvTarget)
+ Case vbString
+ Select Case UCase(pvTarget)
+ Case &quot;FIRST&quot;
+ If _ForwardOnly Then
+ If Not ( .isBeforeFirst() Or .isFirst() ) Then
+ Goto Trace_Forward
+ Else
+ .next()
+ End If
+ Else
+ .first()
+ End If
+ Case &quot;LAST&quot;
+ If _ForwardOnly Then
+ If .isAfterLast() Then Goto Trace_Forward
+ Do While Not ( .isRowCountFinal And .Row = .RowCount ) &apos; isLast() = True after reading of first records chunk
+ .next()
+ Loop
+ Else
+ .last()
+ End If
+ Case &quot;NEXT&quot;
+ If _EOF Then Goto Trace_OutOfRange
+ .next()
+ Case &quot;PREVIOUS&quot;
+ If _ForwardOnly Then Goto Trace_Forward
+ If _BOF Then Goto Trace_OutOfRange
+ .previous()
+ End Select
+ Case Else &apos; Relative or absolute move
+ If IsMissing(pbAbsolute) Then pbAbsolute = False &apos; Relative move is default
+ If _ForwardOnly And pvTarget &lt; 0 then Goto Trace_Forward
+ If IsMissing(pvBookmark) Then
+ If pvTarget = 0 Then Goto Exit_Function &apos; Do nothing
+ If _ForwardOnly Then
+ If pbAbsolute Then lRow = .getRow() Else lRow = 0
+ For l = 1 To pvTarget - lRow
+ If .isAfterLast() Then Exit For
+ .next()
+ Next l
+ Else
+ If pbAbsolute Then .absolute(pvTarget) Else .relative(pvTarget)
+ End If
+ Else &apos; Move is always relative when bookmark argument present
+ If _ForwardOnly Then Goto Trace_Forward
+ If pvTarget = 0 Then
+ .moveToBookmark(pvBookmark)
+ Else
+ .moveRelativeToBookmark(pvBookmark, pvTarget)
+ End If
+ End If
+ End Select
+
+ Select Case True
+ Case .isBeforeFirst()
+ _BOF = True
+ _Move = False
+ Case .isAfterlast()
+ _EOF = True
+ _Move = False
+ Case Else
+ If .rowDeleted() Then Goto Error_RowDeleted
+ If .rowUpdated() Then .refreshRow()
+ _Move = True
+ End Select
+ End With
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Exit_Close: &apos; Force close of recordset when error raised
+ mClose()
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Close
+Trace_Forward:
+ TraceError(TRACEFATAL, ERRRECORDSETFORWARD, Utils._CalledSub(), 0)
+ Goto Exit_Close
+Trace_NoData:
+ TraceError(TRACEFATAL, ERRRECORDSETNODATA, Utils._CalledSub(), 0)
+ Goto Exit_Close
+Trace_OutOfRange:
+ TraceError(TRACEFATAL, ERRRECORDSETRANGE, Utils._CalledSub(), 0)
+ Goto Exit_Close
+Error_RowDeleted:
+ TraceError(TRACEFATAL, ERRROWDELETED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Trace_Closed:
+ TraceError(TRACEFATAL, ERRRECORDSETCLOSED, Utils._CalledSub(), 0)
+ Goto Exit_Close
+End Function &apos; Move
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ _PropertiesList = Array(&quot;AbsolutePosition&quot;, &quot;BOF&quot;, &quot;Bookmarkable&quot;, &quot;Bookmark&quot;, &quot;EditMode&quot; _
+ , &quot;EOF&quot;, &quot;Filter&quot;, &quot;LastModified&quot;, &quot;Name&quot;, &quot;ObjectType&quot; , &quot;RecordCount&quot; _
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Dim cstThisSub As String
+ cstThisSub = &quot;Recordset.get&quot;
+ Utils._SetCalledSub(cstThisSub &amp; psProperty)
+
+Dim vEMPTY As Variant
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AbsolutePosition&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ With RowSet
+ Select Case True
+ Case _BOF And _EOF : _PropertyGet = -1
+ Case .isBeforeFirst() Or .isAfterLast() : _PropertyGet = -1
+ Case Else : _PropertyGet = .getRow() &apos; Not getRow() - 1 as MSAccess requires
+ End Select
+ End With
+ Case UCase(&quot;BOF&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ Select Case True
+ Case _BOF And _EOF : _PropertyGet = True
+ Case RowSet.isBeforeFirst() : _PropertyGet = True
+ Case Else : _PropertyGet = False
+ End Select
+ Case UCase(&quot;Bookmarkable&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ If _ForwardOnly Then _PropertyGet = False Else _PropertyGet = RowSet.IsBookmarkable
+ Case UCase(&quot;Bookmark&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ If RowSet.IsBookmarkable And Not _ForwardOnly Then
+ If _BOF Or _EOF Then _PropertyGet = Null Else _PropertyGet = RowSet.getBookmark()
+ Else
+ _PropertyGet = Null
+ If _ForwardOnly Then Goto Trace_Forward
+ End If
+ Case UCase(&quot;EditMode&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ _PropertyGet = _EditMode
+ Case UCase(&quot;EOF&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ Select Case True
+ Case _BOF And _EOF : _PropertyGet = True
+ Case RowSet.isAfterLast() : _PropertyGet = True
+ Case Else : _PropertyGet = False
+ End Select
+ Case UCase(&quot;Filter&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ _PropertyGet = RowSet.Filter
+ Case UCase(&quot;LastModified&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ If RowSet.IsBookmarkable And Not _ForwardOnly Then
+ _PropertyGet = _BookmarkLastModified
+ Else
+ _PropertyGet = Null
+ If _ForwardOnly Then Goto Trace_Forward
+ End If
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;RecordCount&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ _PropertyGet = RowSet.RowCount
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Forward:
+ TraceError(TRACEFATAL, ERRRECORDSETFORWARD, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Trace_Closed:
+ TraceError(TRACEFATAL, ERRRECORDSETCLOSED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub &amp; &quot;._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+
+Dim cstThisSub As String
+ cstThisSub = &quot;Recordset.set&quot;
+ Utils._SetCalledSub(cstThisSub &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _PropertySet = True
+
+&apos;Execute
+Dim iArgNr As Integer
+Dim oObject As Object
+
+ If Len(_A2B_.CalledSub) &gt; 10 And Left(_A2B_.CalledSub, 10) = &quot;Recordset.&quot; Then iArgNr = 1 Else iArgNr = 2
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AbsolutePosition&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ If pvValue &lt; 1 Then Goto Trace_Error_Value
+ _Move(pvValue, , True)
+ Case UCase(&quot;Bookmark&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ _Move(0, pvValue)
+ Case UCase(&quot;Filter&quot;)
+ If IsNull(RowSet) Then Goto Trace_Closed
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ _Filter = Utils._ReplaceSquareBrackets(pvValue)
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Closed:
+ TraceError(TRACEFATAL, ERRRECORDSETCLOSED, Utils._CalledSub(), 0)
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, Utils._CalledSub(), Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set Bookmark(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Bookmark&quot;, pvValue)
+End Property &apos; Bookmark (set)
+
+Property Set Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/SubForm.xba b/wizards/source/access2base/SubForm.xba
new file mode 100644
index 000000000000..dc93a988d9e2
--- /dev/null
+++ b/wizards/source/access2base/SubForm.xba
@@ -0,0 +1,540 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="SubForm" script:language="StarBasic">Option Compatible
+Option ClassModule
+
+Option Explicit
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS ROOT FIELDS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private _Type As String &apos; Must be SUBFORM
+Private _Shortcut As String
+Private _Name As String
+Public ParentComponent As Object &apos; com.sun.star.text.TextDocument
+Public DatabaseForm As Object &apos; com.sun.star.form.component.DataForm and com.sun.star.sdb.ResultSet (a.o.)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CONSTRUCTORS / DESTRUCTORS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Sub Class_Initialize()
+ _Type = OBJSUBFORM
+ _Shortcut = &quot;&quot;
+ _Name = &quot;&quot;
+ Set ParentComponent = Nothing
+ Set DatabaseForm = Nothing
+End Sub &apos; Constructor
+
+REM -----------------------------------------------------------------------------------------------------------------------
+&apos;Private Sub Class_Terminate()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS GET/LET/SET PROPERTIES ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowAdditions() As Variant
+ AllowAdditions = _PropertyGet(&quot;AllowAdditions&quot;)
+End Property &apos; AllowAdditions (get)
+
+Property Let AllowAdditions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowAdditions&quot;, pvValue)
+End Property &apos; AllowAdditions (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowDeletions() As Variant
+ AllowDeletions = _PropertyGet(&quot;AllowDeletions&quot;)
+End Property &apos; AllowDeletions (get)
+
+Property Let AllowDeletions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowDeletions&quot;, pvValue)
+End Property &apos; AllowDeletions (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get AllowEdits() As Variant
+ AllowEdits = _PropertyGet(&quot;AllowEdits&quot;)
+End Property &apos; AllowEdits (get)
+
+Property Let AllowEdits(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowEdits&quot;, pvValue)
+End Property &apos; AllowEdits (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get CurrentRecord() As Variant
+ CurrentRecord = _PropertyGet(&quot;CurrentRecord&quot;)
+End Property &apos; CurrentRecord (get)
+
+Property Let CurrentRecord(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;CurrentRecord&quot;, pvValue)
+End Property &apos; CurrentRecord (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Filter() As Variant
+ Filter = _PropertyGet(&quot;Filter&quot;)
+End Property &apos; Filter (get)
+
+Property Let Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get FilterOn() As Variant
+ FilterOn = _PropertyGet(&quot;FilterOn&quot;)
+End Property &apos; FilterOn (get)
+
+Property Let FilterOn(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FilterOn&quot;, pvValue)
+End Property &apos; FilterOn (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get LinkChildFields(ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvIndex) Then LinkChildFields = _PropertyGet(&quot;LinkChildFields&quot;) Else LinkChildFields = _PropertyGet(&quot;LinkChildFields&quot;, pvIndex)
+End Property &apos; LinkChildFields (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get LinkMasterFields(ByVal Optional pvIndex As Variant) As Variant
+ If IsMissing(pvIndex) Then LinkMasterFields = _PropertyGet(&quot;LinkMasterFields&quot;) Else LinkMasterFields = _PropertyGet(&quot;LinkMasterFields&quot;, pvIndex)
+End Property &apos; LinkMasterFields (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Name() As String
+ Name = _PropertyGet(&quot;Name&quot;)
+End Property &apos; Name (get)
+
+Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
+ pName = _PropertyGet(&quot;Name&quot;)
+End Function &apos; pName (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get ObjectType() As String
+ ObjectType = _PropertyGet(&quot;ObjectType&quot;)
+End Property &apos; ObjectType (get)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function OptionGroup(ByVal Optional pvGroupName As Variant) As Variant
+&apos; Return either an error or an object of type OPTIONGROUP based on its name
+
+ Utils._SetCalledSub(&quot;SubForm.OptionGroup&quot;)
+ If IsMissing(pvGroupName) Then Call _TraceArguments()
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+
+ Set OptionGroup = _OptionGroup(pvGroupName, CTLPARENTISSUBFORM, DatabaseForm, ParentComponent)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.OptionGroup&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.OptionGroup&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; OptionGroup
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Parent() As Object
+
+ Utils._SetCalledSub(&quot;SubForm.getParent&quot;)
+ On Error Goto Error_Function
+
+ Set Parent = PropertiesGet._ParentObject(_Shortcut)
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.getParent&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.getParent&quot;, Erl)
+ Set Parent = Nothing
+ GoTo Exit_Function
+End Function &apos; Parent
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
+&apos; Return
+&apos; a Collection object if pvIndex absent
+&apos; a Property object otherwise
+
+Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
+ vPropertiesList = _PropertiesList()
+ sObject = Utils._PCase(_Type)
+ If IsMissing(pvIndex) Then
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
+ Else
+ vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
+ vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
+ End If
+
+Exit_Function:
+ Set Properties = vProperty
+ Exit Function
+End Function &apos; Properties
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get Recordset() As Object
+ Recordset = _PropertyGet(&quot;Recordset&quot;)
+End Property &apos; Recordset (get) V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Property Get RecordSource() As Variant
+ RecordSource = _PropertyGet(&quot;RecordSource&quot;)
+End Property &apos; RecordSource (get)
+
+Property Let RecordSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RecordSource&quot;, pvValue)
+End Property &apos; RecordSource (set)
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS METHODS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
+&apos; Return a Control object with name or index = pvIndex
+
+If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;SubForm.Controls&quot;)
+
+Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
+Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
+Dim j As Integer
+
+ Set ocControl = Nothing
+ iControlCount = DatabaseForm.getCount()
+
+ If IsMissing(pvIndex) Then &apos; No argument, return Collection pseudo-object
+ Set oCounter = New Collect
+ oCounter._CollType = COLLCONTROLS
+ oCounter._ParentType = OBJSUBFORM
+ oCounter._ParentName = _Shortcut
+ oCounter._Count = iControlCount
+ Set Controls = oCounter
+ Goto Exit_Function
+ End If
+
+ If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
+
+ &apos; Start building the ocControl object
+ &apos; Determine exact name
+ Set ocControl = New Control
+ ocControl._ParentType = CTLPARENTISSUBFORM
+ sParentShortcut = _Shortcut
+ sControls() = DatabaseForm.getElementNames()
+
+ Select Case VarType(pvIndex)
+ Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
+ If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
+ ocControl._Name = sControls(pvIndex)
+ Case vbString &apos; Check control name validity (non case sensitive)
+ bFound = False
+ sIndex = UCase(Utils._Trim(pvIndex))
+ For i = 0 To iControlCount - 1
+ If UCase(sControls(i)) = sIndex Then
+ bFound = True
+ Exit For
+ End If
+ Next i
+ If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
+ End Select
+
+ ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
+ Set ocControl.ControlModel = DatabaseForm.getByName(ocControl._Name)
+ ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
+ ocControl._FormComponent = ParentComponent
+ If Utils._hasUNOProperty(ocControl.ControlModel, &quot;ClassId&quot;) Then ocControl._ClassId = ocControl.ControlModel.ClassId
+ If ocControl._ClassId &gt; 0 And ocControl._ClassId &lt;&gt; acHiddenControl Then
+ Set ocControl.ControlView = ParentComponent.CurrentController.getControl(ocControl.ControlModel)
+ End If
+
+ ocControl._Initialize()
+ Set Controls = ocControl
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.Controls&quot;)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
+ Set Controls = Nothing
+ Goto Exit_Function
+Trace_NotFound:
+ TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, _Name))
+ Set Controls = Nothing
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.Controls&quot;, Erl)
+ Set Controls = Nothing
+ GoTo Exit_Function
+End Function &apos; Controls
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
+&apos; Return property value of psProperty property name
+
+ Utils._SetCalledSub(&quot;SubForm.getProperty&quot;)
+ If IsMissing(pvProperty) Then Call _TraceArguments()
+ getProperty = _PropertyGet(pvProperty)
+ Utils._ResetCalledSub(&quot;SubForm.getProperty&quot;)
+
+End Function &apos; getProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
+&apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
+
+ If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
+ Exit Function
+
+End Function &apos; hasProperty
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Refresh() As Boolean
+&apos; Refresh data with its most recent value in the database in a form or subform
+ Utils._SetCalledSub(&quot;SubForm.Refresh&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Refresh = False
+
+Dim oSet As Object
+ Set oSet = DatabaseForm.createResultSet()
+ If Not IsNull(oSet) Then
+ oSet.refreshRow()
+ Refresh = True
+ End If
+
+Exit_Function:
+ Set oSet = Nothing
+ Utils._ResetCalledSub(&quot;SubForm.Refresh&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.Refresh&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Refresh
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function Requery() As Boolean
+&apos; Refresh data displayed in a form, subform, combobox or listbox
+ Utils._SetCalledSub(&quot;SubForm.Requery&quot;)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Requery = False
+
+ DatabaseForm.reload()
+ Requery = True
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.Requery&quot;)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm.Requery&quot;, Erl)
+ GoTo Exit_Function
+End Function &apos; Requery
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
+&apos; Return True if property setting OK
+ Utils._SetCalledSub(&quot;SubForm.setProperty&quot;)
+ setProperty = _PropertySet(psProperty, pvValue)
+ Utils._ResetCalledSub(&quot;SubForm.setProperty&quot;)
+End Function
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertiesList() As Variant
+
+ _PropertiesList = Array(&quot;AllowAdditions&quot;, &quot;AllowDeletions&quot;, &quot;AllowEdits&quot;, &quot;CurrentRecord&quot; _
+ , &quot;Filter&quot;, &quot;FilterOn&quot;, &quot;LinkChildFields&quot;, &quot;LinkMasterFields&quot;, &quot;Name&quot; _
+ , &quot;ObjectType&quot;, &quot;Parent&quot;, &quot;RecordSource&quot; _
+ ) &apos; Recordset removed
+
+End Function &apos; _PropertiesList
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertyGet(ByVal psProperty As String, ByVal Optional pvIndex As Variant) As Variant
+&apos; Return property value of the psProperty property name
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ Utils._SetCalledSub(&quot;SubForm.get&quot; &amp; psProperty)
+Dim iArgNr As Integer
+ If Not IsMissing(pvIndex) Then
+ Select Case UCase(_A2B_.CalledSub)
+ Case UCase(&quot;getProperty&quot;) : iArgNr = 3
+ Case UCase(&quot;SubForm.getProperty&quot;) : iArgNr = 2
+ Case UCase(&quot;SubForm.get&quot; &amp; psProperty) : iArgNr = 1
+ End Select
+ If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
+ End If
+
+&apos;Execute
+Dim oDatabase As Object, vBookmark As Variant, vEMPTY As Variant
+ _PropertyGet = vEMPTY
+
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AllowAdditions&quot;)
+ _PropertyGet = DatabaseForm.AllowInserts
+ Case UCase(&quot;AllowDeletions&quot;)
+ _PropertyGet = DatabaseForm.AllowDeletes
+ Case UCase(&quot;AllowEdits&quot;)
+ _PropertyGet = DatabaseForm.AllowUpdates
+ Case UCase(&quot;CurrentRecord&quot;)
+ _PropertyGet = DatabaseForm.Row
+ Case UCase(&quot;Filter&quot;)
+ _PropertyGet = DatabaseForm.Filter
+ Case UCase(&quot;FilterOn&quot;)
+ _PropertyGet = DatabaseForm.ApplyFilter
+ Case UCase(&quot;LinkChildFields&quot;)
+ If Utils._hasUNOProperty(DatabaseForm, &quot;DetailFields&quot;) Then
+ If IsMissing(pvIndex) Then
+ _PropertyGet = DatabaseForm.DetailFields
+ Else
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(DatabaseForm.DetailFields) Then Goto trace_Error_Index
+ _PropertyGet = DatabaseForm.DetailFields(pvIndex)
+ End If
+ End If
+ Case UCase(&quot;LinkMasterFields&quot;)
+ If Utils._hasUNOProperty(DatabaseForm, &quot;MasterFields&quot;) Then
+ If IsMissing(pvIndex) Then
+ _PropertyGet = DatabaseForm.MasterFields
+ Else
+ If pvIndex &lt; 0 Or pvIndex &gt; UBound(DatabaseForm.MasterFields) Then Goto trace_Error_Index
+ _PropertyGet = DatabaseForm.MasterFields(pvIndex)
+ End If
+ End If
+ Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
+ Case UCase(&quot;ObjectType&quot;)
+ _PropertyGet = _Type
+ Case UCase(&quot;Recordset&quot;)
+ If DatabaseForm.Command = &quot;&quot; Then Goto Trace_Error &apos; No underlying data ??
+ Set oObject = New Recordset
+ With DatabaseForm
+ oObject._CommandType = DatabaseForm.CommandType
+ oObject._Command = DatabaseForm.Command
+ oObject._ParentName = _Name
+ oObject._ParentType = _Type
+ oObject._ForwardOnly = ( .ResultSetType = com.sun.star.sdbc.ResultSetType.FORWARD_ONLY )
+ oObject._PassThrough = ( .EscapeProcessing = False )
+ oObject._ReadOnly = ( .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY )
+ Call oObject._Initialize()
+ End With
+ Set oDatabase = Application._CurrentDb()
+ With oDatabase
+ .RecordsetMax = .RecordsetMax + 1
+ oObject._Name = Format(.RecordsetMax, &quot;0000000&quot;)
+ .RecordsetsColl.Add(oObject, UCase(oObject._Name))
+ End With
+ Set _PropertyGet = oObject
+ Case UCase(&quot;RecordSource&quot;)
+ _PropertyGet = DatabaseForm.ActiveCommand
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.get&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Trace_Error_Index:
+ TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertyGet = vEMPTY
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm._PropertyGet&quot;, Erl)
+ _PropertyGet = vEMPTY
+ GoTo Exit_Function
+End Function &apos; _PropertyGet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
+
+ Utils._SetCalledSub(&quot;SubForm.set&quot; &amp; psProperty)
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+ _PropertySet = True
+
+&apos;Execute
+Dim iArgNr As Integer
+
+ If Len(_A2B_.CalledSub) &gt; 8 And Left(_A2B_.CalledSub, 5) = &quot;SubForm.&quot; Then iArgNr = 1 Else iArgNr = 2
+ Select Case UCase(psProperty)
+ Case UCase(&quot;AllowAdditions&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowInserts = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;AllowDeletions&quot;)
+ If Not Utils._CheckArgument(pvValue,iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowDeletes = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;AllowEdits&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.AllowUpdates = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;CurrentRecord&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
+ DatabaseForm.absolute(pvValue)
+ Case UCase(&quot;Filter&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ DatabaseForm.Filter = Utils._ReplaceSquareBrackets(pvValue)
+ Case UCase(&quot;FilterOn&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
+ DatabaseForm.ApplyFilter = pvValue
+ DatabaseForm.reload()
+ Case UCase(&quot;RecordSource&quot;)
+ If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
+ DatabaseForm.Command = Utils._ReplaceSquareBrackets(pvValue)
+ DatabaseForm.CommandType = com.sun.star.sdb.CommandType.COMMAND
+ DatabaseForm.Filter = &quot;&quot;
+ DatabaseForm.reload()
+ Case Else
+ Goto Trace_Error
+ End Select
+
+Exit_Function:
+ Utils._ResetCalledSub(&quot;SubForm.set&quot; &amp; psProperty)
+ Exit Function
+Trace_Error:
+ TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
+ _PropertySet = False
+ Goto Exit_Function
+Trace_Error_Value:
+ TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
+ _PropertySet = False
+ Goto Exit_Function
+Error_Function:
+ TraceError(TRACEABORT, Err, &quot;SubForm._PropertySet&quot;, Erl)
+ _PropertySet = False
+ GoTo Exit_Function
+End Function &apos; _PropertySet
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- CLASS PROPERTY SETs ---
+REM --- Workaround to bug https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60752 (LibreOffice 4.0) ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Property Set AllowAdditions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowAdditions&quot;, pvValue)
+End Property &apos; AllowAdditions (set)
+
+Property Set AllowDeletions(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowDeletions&quot;, pvValue)
+End Property &apos; AllowDeletions (set)
+
+Property Set AllowEdits(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;AllowEdits&quot;, pvValue)
+End Property &apos; AllowEdits (set)
+
+Property Set CurrentRecord(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;CurrentRecord&quot;, pvValue)
+End Property &apos; CurrentRecord (set)
+
+Property Set Filter(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;Filter&quot;, pvValue)
+End Property &apos; Filter (set)
+
+Property Set FilterOn(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;FilterOn&quot;, pvValue)
+End Property &apos; FilterOn (set)
+
+Property Set RecordSource(ByVal pvValue As Variant)
+ Call _PropertySet(&quot;RecordSource&quot;, pvValue)
+End Property &apos; RecordSource (set)
+
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Test.xba b/wizards/source/access2base/Test.xba
new file mode 100644
index 000000000000..c96340c1599c
--- /dev/null
+++ b/wizards/source/access2base/Test.xba
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Test" script:language="StarBasic">Option Explicit
+&apos;Option Compatible
+
+Sub Main
+ Application._RootInit()
+ _A2B_.CalledSub = &quot;&quot;
+ Application.SysCmd(acSysCmdRemoveMeter)
+Dim a as variant, b as variant, c as variant, d as variant, i as integer, s as string,f as variant, h as variant, j as long, k as integer, l as integer, sFile As String
+Dim lTime1 as Date, lTime2 as Long
+ lTime1=getsystemticks()
+&apos; TraceConsole()
+
+ lTime2=getsystemticks
+ debugprint lTime2 - lTime1
+ exit sub
+End Sub
+</script:module> \ No newline at end of file
diff --git a/wizards/source/access2base/Trace.xba b/wizards/source/access2base/Trace.xba
new file mode 100644
index 000000000000..42209d7ce6e4
--- /dev/null
+++ b/wizards/source/access2base/Trace.xba
@@ -0,0 +1,415 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Trace" script:language="StarBasic">Option Explicit
+
+Public Const cstLogMaxEntries = 20
+
+REM Typical Usage
+REM TraceLog(&quot;INFO&quot;, &quot;The OK button was pressed&quot;)
+REM
+REM Typical Usage for error logging
+REM Sub MySub()
+REM On Local Error GoTo Error_Sub
+REM ...
+REM Exit_Sub:
+REM Exit Sub
+REM Error_Sub:
+REM TraceError(&quot;ERROR&quot;, Err, &quot;MySub&quot;, Erl)
+REM GoTo Exit_Sub
+REM End Sub
+REM
+REM To display the current logged traces and/or to set parameters
+REM TraceConsole()
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub TraceConsole()
+&apos; Display the Trace dialog with current trace log values and parameter choices
+If _ErrorHandler() Then On Local Error Goto Error_Sub
+
+Dim sLineBreak As String, oDialogLib As Object, oTraceDialog As Object
+ sLineBreak = Chr(10)
+
+ Set oDialogLib = DialogLibraries
+ If Not oDialogLib.IsLibraryLoaded(&quot;Access2Base&quot;) Then oDialogLib.loadLibrary(&quot;Access2Base&quot;)
+ Set oTraceDialog = CreateUnoDialog(DialogLibraries.Access2Base.dlgTrace)
+ oTraceDialog.Title = _GetLabel(&quot;DLGTRACE_TITLE&quot;) &apos; HelpText ???
+
+Dim oEntries As Object, oTraceLog As Object, oClear As Object, oMinLevel As Object, oNbEntries As Object, oDump As Object
+Dim oControl As Object
+Dim i As Integer, sText As String, iOKCancel As Integer
+
+ Set oNbEntries = oTraceDialog.Model.getByName(&quot;numNbEntries&quot;)
+ oNbEntries.Value = _A2B_.TraceLogCount
+ oNbEntries.HelpText = _GetLabel(&quot;DLGTRACE_LBLNBENTRIES_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;lblNbEntries&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_LBLNBENTRIES_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_LBLNBENTRIES_HELP&quot;)
+
+ Set oEntries = oTraceDialog.Model.getByName(&quot;numEntries&quot;)
+ If _A2B_.TraceLogMaxEntries = 0 Then _A2B_.TraceLogMaxEntries = cstLogMaxEntries
+ oEntries.Value = _A2B_.TraceLogMaxEntries
+ oEntries.HelpText = _GetLabel(&quot;DLGTRACE_LBLENTRIES_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;lblEntries&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_LBLENTRIES_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_LBLENTRIES_HELP&quot;)
+
+ Set oDump = oTraceDialog.Model.getByName(&quot;cmdDump&quot;)
+ oDump.Enabled = 0
+ oDump.Label = _GetLabel(&quot;DLGTRACE_CMDDUMP_LABEL&quot;)
+ oDump.HelpText = _GetLabel(&quot;DLGTRACE_CMDDUMP_HELP&quot;)
+
+ Set oTraceLog = oTraceDialog.Model.getByName(&quot;txtTraceLog&quot;)
+ oTraceLog.HelpText = _GetLabel(&quot;DLGTRACE_TXTTRACELOG_HELP&quot;)
+ If UBound(_A2B_.TraceLogs) &gt;= 0 Then &apos; Array yet initialized
+ oTraceLog.HardLineBreaks = True
+ sText = &quot;&quot;
+ If _A2B_.TraceLogCount &gt; 0 Then
+ If _A2B_.TraceLogCount &lt; _A2B_.TraceLogMaxEntries Then i = -1 Else i = _A2B_.TraceLogLast
+ Do
+ If i &lt; _A2B_.TraceLogMaxEntries - 1 Then i = i + 1 Else i = 0
+ If Len(_A2B_.TraceLogs(i)) &gt; 11 Then
+ sText = sText &amp; Right(_A2B_.TraceLogs(i), Len(_A2B_.TraceLogs(i)) - 11) &amp; sLineBreak &apos; Skip date in display
+ End If
+ Loop While i &lt;&gt; _A2B_.TraceLogLast
+ oDump.Enabled = 1 &apos; Enable DumpToFile only if there is something to dump
+ End If
+ If Len(sText) &gt; 0 Then sText = Left(sText, Len(sText) - 1) &apos; Skip last linefeed
+ oTraceLog.Text = sText
+ Else
+ oTraceLog.Text = _GetLabel(&quot;DLGTRACE_TXTTRACELOG_TEXT&quot;)
+ End If
+
+ Set oClear = oTraceDialog.Model.getByName(&quot;chkClear&quot;)
+ oClear.State = 0 &apos; Unchecked
+ oClear.HelpText = _GetLabel(&quot;DLGTRACE_LBLCLEAR_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;lblClear&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_LBLCLEAR_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_LBLCLEAR_HELP&quot;)
+
+ Set oMinLevel = oTraceDialog.Model.getByName(&quot;cboMinLevel&quot;)
+ If _A2B_.MinimalTraceLevel = 0 Then _A2B_.MinimalTraceLevel = _TraceLevel(TRACEERRORS)
+ oMinLevel.Text = _TraceLevel(_A2B_.MinimalTraceLevel)
+ oMinLevel.HelpText = _GetLabel(&quot;DLGTRACE_LBLMINLEVEL_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;lblMinLevel&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_LBLMINLEVEL_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_LBLMINLEVEL_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;cmdOK&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_CMDOK_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_CMDOK_HELP&quot;)
+
+ Set oControl = oTraceDialog.Model.getByName(&quot;cmdCancel&quot;)
+ oControl.Label = _GetLabel(&quot;DLGTRACE_CMDCANCEL_LABEL&quot;)
+ oControl.HelpText = _GetLabel(&quot;DLGTRACE_CMDCANCEL_HELP&quot;)
+
+ iOKCancel = oTraceDialog.Execute()
+
+ Select Case iOKCancel
+ Case 1 &apos; OK
+ If oClear.State = 1 Then
+ _A2B_.TraceLogs() = Array() &apos; Erase logged traces
+ _A2B_.TraceLogCount = 0
+ End If
+ If oMinLevel.Text &lt;&gt; &quot;&quot; Then _A2B_.MinimalTraceLevel = _TraceLevel(oMinLevel.Text)
+ If oEntries.Value &lt;&gt; 0 And oEntries.Value &lt;&gt; _A2B_.TraceLogMaxEntries Then
+ _A2B_.TraceLogs() = Array()
+ _A2B_.TraceLogMaxEntries = oEntries.Value
+ End If
+ Case 0 &apos; Cancel
+ Case Else
+ End Select
+
+Exit_Sub:
+ If Not IsNull(oTraceDialog) Then oTraceDialog.Dispose()
+ Exit Sub
+Error_Sub:
+ With _A2B_
+ .TraceLogs() = Array()
+ .TraceLogCount = 0
+ .TraceLogLast = 0
+ End With
+ GoTo Exit_Sub
+End Sub &apos; TraceConsole V1.0.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub TraceError(ByVal psErrorLevel As String _
+ , ByVal piErrorCode As Integer _
+ , ByVal psErrorProc As String _
+ , ByVal piErrorLine As Integer _
+ , ByVal Optional pvMsgBox As Variant _
+ , ByVal Optional pvArgs As Variant _
+ )
+&apos; store error codes in trace buffer
+
+ On Local Error Resume Next
+
+Dim sErrorText As String, sErrorDesc As String, oDb As Object
+ sErrorDesc = _ErrorMessage(piErrorCode, pvArgs)
+ sErrorText = _GetLabel(&quot;ERR#&quot;) &amp; CStr(piErrorCode) _
+ &amp; &quot; (&quot; &amp; sErrorDesc &amp; &quot;) &quot; &amp; _GetLabel(&quot;ERROCCUR&quot;) _
+ &amp; Iif(piErrorLine &gt; 0, &quot; &quot; &amp; _GetLabel(&quot;ERRLINE&quot;) &amp; &quot; &quot; &amp; CStr(piErrorLine), &quot;&quot;) _
+ &amp; Iif(psErrorProc &lt;&gt; &quot;&quot;, &quot; &quot; &amp; _GetLabel(&quot;ERRIN&quot;) &amp; &quot; &quot; &amp; psErrorProc, Iif(_A2B_.CalledSub = &quot;&quot;, &quot;&quot;, &quot; &quot; &amp; _Getlabel(&quot;ERRIN&quot;) &amp; &quot; &quot; &amp; _A2B_.CalledSub))
+ If IsMissing(pvMsgBox) Then pvMsgBox = ( psErrorLevel = TRACEERRORS Or psErrorLevel = TRACEFATAL Or psErrorLevel = TRACEABORT )
+ TraceLog(psErrorLevel, sErrorText, pvMsgBox)
+
+ &apos; Unexpected error detected in user program or in Access2Base
+ If psErrorLevel = TRACEFATAL Or psErrorLevel = TRACEABORT Then
+ _A2B_.CalledSub = &quot;&quot;
+ If psErrorLevel = TRACEFATAL Then
+ Set oDb = Application.CurrentDb()
+ If Not IsNull(oDb) Then oDb.CloseAllrecordsets()
+ End If
+ Stop
+ End If
+
+End Sub &apos; TraceError V0.9,5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub TraceLevel(ByVal Optional psTraceLevel As String)
+&apos; Set trace level to argument
+
+ If _ErrorHandler() Then On Local Error Goto Error_Sub
+ Select Case True
+ Case IsMissing(psTraceLevel) : psTraceLevel = &quot;ERROR&quot;
+ Case psTraceLevel = &quot;&quot; : psTraceLevel = &quot;ERROR&quot;
+ Case Utils._InList(UCase(psTraceLevel), Array( _
+ TRACEDEBUG, TRACEINFO, TRACEWARNING, TRACEERRORS, TRACEFATAL, TRACEABORT _
+ )
+ Case Else : Goto Exit_Sub
+ End Select
+ _A2B_.MinimalTraceLevel = _TraceLevel(psTraceLevel)
+
+Exit_Sub:
+ Exit Sub
+Error_Sub:
+ With _A2B_
+ .TraceLogs() = Array()
+ .TraceLogCount = 0
+ .TraceLogLast = 0
+ End With
+ GoTo Exit_Sub
+End Sub &apos; TraceLevel V0.9.5
+
+REM -----------------------------------------------------------------------------------------------------------------------
+Public Sub TraceLog(Byval psTraceLevel As String _
+ , ByVal psText As String _
+ , ByVal Optional pbMsgBox As Boolean _
+ )
+&apos; Store Text in trace log (circular buffer)
+If _ErrorHandler() Then On Local Error Goto Error_Sub
+Dim vTraceLogs() As String, sTraceLevel As String
+
+ With _A2B_
+ If .MinimalTraceLevel = 0 Then .MinimalTraceLevel = _TraceLevel(TRACEERRORS)
+ If _TraceLevel(psTraceLevel) &lt; .MinimalTraceLevel Then Exit Sub
+
+ If UBound(.TraceLogs) = -1 Then &apos; Initialize TraceLog
+ If .TraceLogMaxEntries = 0 Then .TraceLogMaxEntries = cstLogMaxEntries
+
+ Redim vTraceLogs(0 To .TraceLogMaxEntries - 1)
+ .TraceLogs = vTraceLogs
+ .TraceLogCount = 0
+ .TraceLogLast = -1
+ If .MinimalTraceLevel = 0 Then .MinimalTraceLevel = _TraceLevel(TRACEERRORS) &apos; Set default value
+ End If
+
+ .TraceLogLast = .TraceLogLast + 1
+ If .TraceLogLast &gt; UBound(.TraceLogs) Then .TraceLogLast = LBound(.TraceLogs) &apos; Circular buffer
+ If Len(psTraceLevel) &gt; 7 Then sTraceLevel = Left(psTraceLevel, 7) Else sTraceLevel = psTraceLevel &amp; Spc(8 - Len(psTraceLevel))
+ .TraceLogs(.TraceLogLast) = Format(Now(), &quot;YYYY-MM-DD hh:mm:ss&quot;) &amp; &quot; &quot; &amp; sTraceLevel &amp; psText
+ If .TraceLogCount &lt;= UBound(.TraceLogs) Then .TraceLogCount = .TraceLogCount + 1 &apos; # of active entries
+ End With
+
+ If IsMissing(pbMsgBox) Then pbMsgBox = True
+Dim iMsgBox As Integer
+ If pbMsgBox Then
+ Select Case psTraceLevel
+ Case TRACEINFO: iMsgBox = vbInformation
+ Case TRACEERRORS, TRACEWARNING: iMsgBox = vbExclamation
+ Case TRACEFATAL, TRACEABORT: iMsgBox = vbCritical
+ Case Else: iMsgBox = vbInformation
+ End Select
+ MsgBox psText, vbOKOnly + iMsgBox, psTraceLevel
+ End If
+
+Exit_Sub:
+ Exit Sub
+Error_Sub:
+ With _A2B_
+ .TraceLogs() = Array()
+ .TraceLogCount = 0
+ .TraceLogLast = 0
+ End With
+ GoTo Exit_Sub
+End Sub &apos; TraceLog V0.9.5
+
+
+REM -----------------------------------------------------------------------------------------------------------------------
+REM --- PRIVATE FUNCTIONS ---
+REM -----------------------------------------------------------------------------------------------------------------------
+
+Private Sub _DumpToFile(oEvent As Object)
+&apos; Execute the Dump To File command from the Trace dialog
+&apos; Modified from Andrew Pitonyak&apos;s Base Macro Programming §10.4
+
+
+If _ErrorHandler() Then On Local Error GoTo Error_Sub
+
+Dim sPath as String, iFileNumber As Integer, i As Integer