summaryrefslogtreecommitdiff
path: root/wizards/source/access2base/SubForm.xba
blob: 6f28c8d7dd12c0d83beca23f003a3e102a6c92d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
<?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">REM =======================================================================================================================
REM ===					The Access2Base library is a part of the LibreOffice project.									===
REM ===					Full documentation is available on http://www.access2base.com									===
REM =======================================================================================================================

Option Compatible
Option ClassModule

Option Explicit

REM -----------------------------------------------------------------------------------------------------------------------
REM --- CLASS ROOT FIELDS 								        														---
REM -----------------------------------------------------------------------------------------------------------------------

Private	_Type					As String				&apos;	Must be SUBFORM
Private _This					As Object
Private	_Shortcut				As String
Private	_Name					As String
Private _DocEntry				As Integer
Private _DbEntry				As Integer
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;
	_DocEntry = -1
	_DbEntry = -1
	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

Const cstThisSub = &quot;SubForm.OptionGroup&quot;
	Utils._SetCalledSub(cstThisSub)
	If IsMissing(pvGroupName) Then Call _TraceArguments()
	If _ErrorHandler() Then On Local Error Goto Error_Function
	
	Set OptionGroup = _OptionGroup(pvGroupName, CTLPARENTISSUBFORM, _This)
	
Exit_Function:
	Utils._ResetCalledSub(cstThisSub)
	Exit Function
Error_Function:
	TraceError(TRACEABORT, Err, cstThisSub, Erl)
	GoTo Exit_Function
End Function		&apos;	OptionGroup	V1.1.0

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()
	ocControl._DocEntry = _DocEntry
	ocControl._DbEntry = _DbEntry
	Set Controls = ocControl
	
Exit_Function:
	Utils._ResetCalledSub(&quot;SubForm.Controls&quot;)
	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	V1.1.0

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 = .CommandType
				oObject._Command = .Command
				oObject._ParentName = _Name
				oObject._ParentType = _Type
				Set oDatabase = Application._CurrentDb(_DocEntry, _DbEntry)
				Set oObject._ParentDatabase = oDatabase
				Set oObject._ParentDatabase.Connection = .ActiveConnection
				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
			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 = Application._CurrentDb(_DocEntry, _DbEntry)._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 = Application._CurrentDb(_DocEntry, _DbEntry)._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>