bump product version to 5.0.4.1
[LibreOffice.git] / wizards / source / access2base / SubForm.xba
blob98af11131c2f73c9274906d7f483e9c68b5a901a
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="SubForm" script:language="StarBasic">REM =======================================================================================================================
4 REM === The Access2Base library is a part of the LibreOffice project. ===
5 REM === Full documentation is available on http://www.access2base.com ===
6 REM =======================================================================================================================
8 Option Compatible
9 Option ClassModule
11 Option Explicit
13 REM -----------------------------------------------------------------------------------------------------------------------
14 REM --- CLASS ROOT FIELDS ---
15 REM -----------------------------------------------------------------------------------------------------------------------
17 Private _Type As String &apos; Must be SUBFORM
18 Private _Shortcut As String
19 Private _Name As String
20 Private _DocEntry As Integer
21 Private _DbEntry As Integer
22 Private _OrderBy As String
23 Public ParentComponent As Object &apos; com.sun.star.text.TextDocument
24 Public DatabaseForm As Object &apos; com.sun.star.form.component.DataForm and com.sun.star.sdb.ResultSet (a.o.)
26 REM -----------------------------------------------------------------------------------------------------------------------
27 REM --- CONSTRUCTORS / DESTRUCTORS ---
28 REM -----------------------------------------------------------------------------------------------------------------------
29 Private Sub Class_Initialize()
30 _Type = OBJSUBFORM
31 _Shortcut = &quot;&quot;
32 _Name = &quot;&quot;
33 _DocEntry = -1
34 _DbEntry = -1
35 _OrderBy = &quot;&quot;
36 Set ParentComponent = Nothing
37 Set DatabaseForm = Nothing
38 End Sub &apos; Constructor
40 REM -----------------------------------------------------------------------------------------------------------------------
41 Private Sub Class_Terminate()
42 On Local Error Resume Next
43 Call Class_Initialize()
44 End Sub &apos; Destructor
46 REM -----------------------------------------------------------------------------------------------------------------------
47 Public Sub Dispose()
48 Call Class_Terminate()
49 End Sub &apos; Explicit destructor
51 REM -----------------------------------------------------------------------------------------------------------------------
52 REM --- CLASS GET/LET/SET PROPERTIES ---
53 REM -----------------------------------------------------------------------------------------------------------------------
54 Property Get AllowAdditions() As Variant
55 AllowAdditions = _PropertyGet(&quot;AllowAdditions&quot;)
56 End Property &apos; AllowAdditions (get)
58 Property Let AllowAdditions(ByVal pvValue As Variant)
59 Call _PropertySet(&quot;AllowAdditions&quot;, pvValue)
60 End Property &apos; AllowAdditions (set)
62 REM -----------------------------------------------------------------------------------------------------------------------
63 Property Get AllowDeletions() As Variant
64 AllowDeletions = _PropertyGet(&quot;AllowDeletions&quot;)
65 End Property &apos; AllowDeletions (get)
67 Property Let AllowDeletions(ByVal pvValue As Variant)
68 Call _PropertySet(&quot;AllowDeletions&quot;, pvValue)
69 End Property &apos; AllowDeletions (set)
71 REM -----------------------------------------------------------------------------------------------------------------------
72 Property Get AllowEdits() As Variant
73 AllowEdits = _PropertyGet(&quot;AllowEdits&quot;)
74 End Property &apos; AllowEdits (get)
76 Property Let AllowEdits(ByVal pvValue As Variant)
77 Call _PropertySet(&quot;AllowEdits&quot;, pvValue)
78 End Property &apos; AllowEdits (set)
80 REM -----------------------------------------------------------------------------------------------------------------------
81 Property Get CurrentRecord() As Variant
82 CurrentRecord = _PropertyGet(&quot;CurrentRecord&quot;)
83 End Property &apos; CurrentRecord (get)
85 Property Let CurrentRecord(ByVal pvValue As Variant)
86 Call _PropertySet(&quot;CurrentRecord&quot;, pvValue)
87 End Property &apos; CurrentRecord (set)
89 REM -----------------------------------------------------------------------------------------------------------------------
90 Property Get Filter() As Variant
91 Filter = _PropertyGet(&quot;Filter&quot;)
92 End Property &apos; Filter (get)
94 Property Let Filter(ByVal pvValue As Variant)
95 Call _PropertySet(&quot;Filter&quot;, pvValue)
96 End Property &apos; Filter (set)
98 REM -----------------------------------------------------------------------------------------------------------------------
99 Property Get FilterOn() As Variant
100 FilterOn = _PropertyGet(&quot;FilterOn&quot;)
101 End Property &apos; FilterOn (get)
103 Property Let FilterOn(ByVal pvValue As Variant)
104 Call _PropertySet(&quot;FilterOn&quot;, pvValue)
105 End Property &apos; FilterOn (set)
107 REM -----------------------------------------------------------------------------------------------------------------------
108 Property Get LinkChildFields(ByVal Optional pvIndex As Variant) As Variant
109 If IsMissing(pvIndex) Then LinkChildFields = _PropertyGet(&quot;LinkChildFields&quot;) Else LinkChildFields = _PropertyGet(&quot;LinkChildFields&quot;, pvIndex)
110 End Property &apos; LinkChildFields (get)
112 REM -----------------------------------------------------------------------------------------------------------------------
113 Property Get LinkMasterFields(ByVal Optional pvIndex As Variant) As Variant
114 If IsMissing(pvIndex) Then LinkMasterFields = _PropertyGet(&quot;LinkMasterFields&quot;) Else LinkMasterFields = _PropertyGet(&quot;LinkMasterFields&quot;, pvIndex)
115 End Property &apos; LinkMasterFields (get)
117 REM -----------------------------------------------------------------------------------------------------------------------
118 Property Get Name() As String
119 Name = _PropertyGet(&quot;Name&quot;)
120 End Property &apos; Name (get)
122 Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
123 pName = _PropertyGet(&quot;Name&quot;)
124 End Function &apos; pName (get)
126 REM -----------------------------------------------------------------------------------------------------------------------
127 Property Get ObjectType() As String
128 ObjectType = _PropertyGet(&quot;ObjectType&quot;)
129 End Property &apos; ObjectType (get)
131 REM -----------------------------------------------------------------------------------------------------------------------
132 Public Function OptionGroup(ByVal Optional pvGroupName As Variant) As Variant
133 &apos; Return either an error or an object of type OPTIONGROUP based on its name
135 Const cstThisSub = &quot;SubForm.OptionGroup&quot;
136 Dim ogGroup As Object
137 Utils._SetCalledSub(cstThisSub)
138 If IsMissing(pvGroupName) Then Call _TraceArguments()
139 If _ErrorHandler() Then On Local Error Goto Error_Function
141 Set ogGroup = _OptionGroup(pvGroupName, CTLPARENTISSUBFORM, ParentComponent, DatabaseForm)
142 If Not IsNull(ogGroup) Then
143 ogGroup._DocEntry = _DocEntry
144 ogGroup._DbEntry = _DbEntry
145 End If
146 Set OptionGroup = ogGroup
148 Exit_Function:
149 Utils._ResetCalledSub(cstThisSub)
150 Exit Function
151 Error_Function:
152 TraceError(TRACEABORT, Err, cstThisSub, Erl)
153 GoTo Exit_Function
154 End Function &apos; OptionGroup V1.1.0
156 REM -----------------------------------------------------------------------------------------------------------------------
157 Property Get OrderBy() As Variant
158 OrderBy = _PropertyGet(&quot;OrderBy&quot;)
159 End Property &apos; OrderBy (get) V1.2.0
161 Property Let OrderBy(ByVal pvValue As Variant)
162 Call _PropertySet(&quot;OrderBy&quot;, pvValue)
163 End Property &apos; OrderBy (set)
165 REM -----------------------------------------------------------------------------------------------------------------------
166 Property Get OrderByOn() As Variant
167 OrderByOn = _PropertyGet(&quot;OrderByOn&quot;)
168 End Property &apos; OrderByOn (get) V1.2.0
170 Property Let OrderByOn(ByVal pvValue As Variant)
171 Call _PropertySet(&quot;OrderByOn&quot;, pvValue)
172 End Property &apos; OrderByOn (set)
174 REM -----------------------------------------------------------------------------------------------------------------------
175 Public Function Parent() As Object
177 Utils._SetCalledSub(&quot;SubForm.getParent&quot;)
178 On Error Goto Error_Function
180 Set Parent = PropertiesGet._ParentObject(_Shortcut)
182 Exit_Function:
183 Utils._ResetCalledSub(&quot;SubForm.getParent&quot;)
184 Exit Function
185 Error_Function:
186 TraceError(TRACEABORT, Err, &quot;SubForm.getParent&quot;, Erl)
187 Set Parent = Nothing
188 GoTo Exit_Function
189 End Function &apos; Parent
191 REM -----------------------------------------------------------------------------------------------------------------------
192 Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
193 &apos; Return
194 &apos; a Collection object if pvIndex absent
195 &apos; a Property object otherwise
197 Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
198 vPropertiesList = _PropertiesList()
199 sObject = Utils._PCase(_Type)
200 If IsMissing(pvIndex) Then
201 vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
202 Else
203 vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
204 vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
205 End If
207 Exit_Function:
208 Set Properties = vProperty
209 Exit Function
210 End Function &apos; Properties
212 REM -----------------------------------------------------------------------------------------------------------------------
213 Property Get Recordset() As Object
214 Recordset = _PropertyGet(&quot;Recordset&quot;)
215 End Property &apos; Recordset (get) V0.9.5
217 REM -----------------------------------------------------------------------------------------------------------------------
218 Property Get RecordSource() As Variant
219 RecordSource = _PropertyGet(&quot;RecordSource&quot;)
220 End Property &apos; RecordSource (get)
222 Property Let RecordSource(ByVal pvValue As Variant)
223 Call _PropertySet(&quot;RecordSource&quot;, pvValue)
224 End Property &apos; RecordSource (set)
226 REM -----------------------------------------------------------------------------------------------------------------------
227 REM --- CLASS METHODS ---
228 REM -----------------------------------------------------------------------------------------------------------------------
229 Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
230 &apos; Return a Control object with name or index = pvIndex
232 If _ErrorHandler() Then On Local Error Goto Error_Function
233 Utils._SetCalledSub(&quot;SubForm.Controls&quot;)
235 Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
236 Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
237 Dim j As Integer
239 Set ocControl = Nothing
240 iControlCount = DatabaseForm.getCount()
242 If IsMissing(pvIndex) Then &apos; No argument, return Collection pseudo-object
243 Set oCounter = New Collect
244 oCounter._CollType = COLLCONTROLS
245 oCounter._ParentType = OBJSUBFORM
246 oCounter._ParentName = _Shortcut
247 oCounter._Count = iControlCount
248 Set Controls = oCounter
249 Goto Exit_Function
250 End If
252 If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
254 &apos; Start building the ocControl object
255 &apos; Determine exact name
256 Set ocControl = New Control
257 ocControl._ParentType = CTLPARENTISSUBFORM
258 sParentShortcut = _Shortcut
259 sControls() = DatabaseForm.getElementNames()
261 Select Case VarType(pvIndex)
262 Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
263 If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
264 ocControl._Name = sControls(pvIndex)
265 Case vbString &apos; Check control name validity (non case sensitive)
266 bFound = False
267 sIndex = UCase(Utils._Trim(pvIndex))
268 For i = 0 To iControlCount - 1
269 If UCase(sControls(i)) = sIndex Then
270 bFound = True
271 Exit For
272 End If
273 Next i
274 If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
275 End Select
277 ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
278 Set ocControl.ControlModel = DatabaseForm.getByName(ocControl._Name)
279 ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
280 ocControl._FormComponent = ParentComponent
281 If Utils._hasUNOProperty(ocControl.ControlModel, &quot;ClassId&quot;) Then ocControl._ClassId = ocControl.ControlModel.ClassId
282 If ocControl._ClassId &gt; 0 And ocControl._ClassId &lt;&gt; acHiddenControl Then
283 Set ocControl.ControlView = ParentComponent.CurrentController.getControl(ocControl.ControlModel)
284 End If
286 ocControl._Initialize()
287 ocControl._DocEntry = _DocEntry
288 ocControl._DbEntry = _DbEntry
289 Set Controls = ocControl
291 Exit_Function:
292 Utils._ResetCalledSub(&quot;SubForm.Controls&quot;)
293 Exit Function
294 Trace_Error_Index:
295 TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
296 Set Controls = Nothing
297 Goto Exit_Function
298 Trace_NotFound:
299 TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, _Name))
300 Set Controls = Nothing
301 Goto Exit_Function
302 Error_Function:
303 TraceError(TRACEABORT, Err, &quot;SubForm.Controls&quot;, Erl)
304 Set Controls = Nothing
305 GoTo Exit_Function
306 End Function &apos; Controls V1.1.0
308 REM -----------------------------------------------------------------------------------------------------------------------
309 Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
310 &apos; Return property value of psProperty property name
312 Utils._SetCalledSub(&quot;SubForm.getProperty&quot;)
313 If IsMissing(pvProperty) Then Call _TraceArguments()
314 getProperty = _PropertyGet(pvProperty)
315 Utils._ResetCalledSub(&quot;SubForm.getProperty&quot;)
317 End Function &apos; getProperty
319 REM -----------------------------------------------------------------------------------------------------------------------
320 Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
321 &apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
323 If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
324 Exit Function
326 End Function &apos; hasProperty
328 REM -----------------------------------------------------------------------------------------------------------------------
329 Public Function Refresh() As Boolean
330 &apos; Refresh data with its most recent value in the database in a form or subform
331 Utils._SetCalledSub(&quot;SubForm.Refresh&quot;)
332 If _ErrorHandler() Then On Local Error Goto Error_Function
333 Refresh = False
335 Dim oSet As Object
336 Set oSet = DatabaseForm.createResultSet()
337 If Not IsNull(oSet) Then
338 oSet.refreshRow()
339 Refresh = True
340 End If
342 Exit_Function:
343 Set oSet = Nothing
344 Utils._ResetCalledSub(&quot;SubForm.Refresh&quot;)
345 Exit Function
346 Error_Function:
347 TraceError(TRACEABORT, Err, &quot;SubForm.Refresh&quot;, Erl)
348 GoTo Exit_Function
349 End Function &apos; Refresh
351 REM -----------------------------------------------------------------------------------------------------------------------
352 Public Function Requery() As Boolean
353 &apos; Refresh data displayed in a form, subform, combobox or listbox
354 Utils._SetCalledSub(&quot;SubForm.Requery&quot;)
355 If _ErrorHandler() Then On Local Error Goto Error_Function
356 Requery = False
358 DatabaseForm.reload()
359 Requery = True
361 Exit_Function:
362 Utils._ResetCalledSub(&quot;SubForm.Requery&quot;)
363 Exit Function
364 Error_Function:
365 TraceError(TRACEABORT, Err, &quot;SubForm.Requery&quot;, Erl)
366 GoTo Exit_Function
367 End Function &apos; Requery
369 REM -----------------------------------------------------------------------------------------------------------------------
370 Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
371 &apos; Return True if property setting OK
372 Utils._SetCalledSub(&quot;SubForm.setProperty&quot;)
373 setProperty = _PropertySet(psProperty, pvValue)
374 Utils._ResetCalledSub(&quot;SubForm.setProperty&quot;)
375 End Function
377 REM -----------------------------------------------------------------------------------------------------------------------
378 REM --- PRIVATE FUNCTIONS ---
379 REM -----------------------------------------------------------------------------------------------------------------------
380 REM -----------------------------------------------------------------------------------------------------------------------
381 Private Function _PropertiesList() As Variant
383 _PropertiesList = Array(&quot;AllowAdditions&quot;, &quot;AllowDeletions&quot;, &quot;AllowEdits&quot;, &quot;CurrentRecord&quot; _
384 , &quot;Filter&quot;, &quot;FilterOn&quot;, &quot;LinkChildFields&quot;, &quot;LinkMasterFields&quot;, &quot;Name&quot; _
385 , &quot;ObjectType&quot;, &quot;OrderBy&quot;, &quot;OrderByOn&quot;, &quot;Parent&quot;, &quot;RecordSource&quot; _
386 ) &apos; Recordset removed
388 End Function &apos; _PropertiesList
390 REM -----------------------------------------------------------------------------------------------------------------------
391 Private Function _PropertyGet(ByVal psProperty As String, ByVal Optional pvIndex As Variant) As Variant
392 &apos; Return property value of the psProperty property name
394 If _ErrorHandler() Then On Local Error Goto Error_Function
395 Utils._SetCalledSub(&quot;SubForm.get&quot; &amp; psProperty)
396 Dim iArgNr As Integer
397 If Not IsMissing(pvIndex) Then
398 Select Case UCase(_A2B_.CalledSub)
399 Case UCase(&quot;getProperty&quot;) : iArgNr = 3
400 Case UCase(&quot;SubForm.getProperty&quot;) : iArgNr = 2
401 Case UCase(&quot;SubForm.get&quot; &amp; psProperty) : iArgNr = 1
402 End Select
403 If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
404 End If
406 &apos;Execute
407 Dim oDatabase As Object, vBookmark As Variant, vEMPTY As Variant
408 _PropertyGet = vEMPTY
410 Select Case UCase(psProperty)
411 Case UCase(&quot;AllowAdditions&quot;)
412 _PropertyGet = DatabaseForm.AllowInserts
413 Case UCase(&quot;AllowDeletions&quot;)
414 _PropertyGet = DatabaseForm.AllowDeletes
415 Case UCase(&quot;AllowEdits&quot;)
416 _PropertyGet = DatabaseForm.AllowUpdates
417 Case UCase(&quot;CurrentRecord&quot;)
418 _PropertyGet = DatabaseForm.Row
419 Case UCase(&quot;Filter&quot;)
420 _PropertyGet = DatabaseForm.Filter
421 Case UCase(&quot;FilterOn&quot;)
422 _PropertyGet = DatabaseForm.ApplyFilter
423 Case UCase(&quot;LinkChildFields&quot;)
424 If Utils._hasUNOProperty(DatabaseForm, &quot;DetailFields&quot;) Then
425 If IsMissing(pvIndex) Then
426 _PropertyGet = DatabaseForm.DetailFields
427 Else
428 If pvIndex &lt; 0 Or pvIndex &gt; UBound(DatabaseForm.DetailFields) Then Goto trace_Error_Index
429 _PropertyGet = DatabaseForm.DetailFields(pvIndex)
430 End If
431 End If
432 Case UCase(&quot;LinkMasterFields&quot;)
433 If Utils._hasUNOProperty(DatabaseForm, &quot;MasterFields&quot;) Then
434 If IsMissing(pvIndex) Then
435 _PropertyGet = DatabaseForm.MasterFields
436 Else
437 If pvIndex &lt; 0 Or pvIndex &gt; UBound(DatabaseForm.MasterFields) Then Goto trace_Error_Index
438 _PropertyGet = DatabaseForm.MasterFields(pvIndex)
439 End If
440 End If
441 Case UCase(&quot;Name&quot;)
442 _PropertyGet = _Name
443 Case UCase(&quot;ObjectType&quot;)
444 _PropertyGet = _Type
445 Case UCase(&quot;OrderBy&quot;)
446 _PropertyGet = _OrderBy
447 Case UCase(&quot;OrderByOn&quot;)
448 If DatabaseForm.Order = &quot;&quot; Then _PropertyGet = False Else _PropertyGet = True
449 Case UCase(&quot;Recordset&quot;)
450 If DatabaseForm.Command = &quot;&quot; Then Goto Trace_Error &apos; No underlying data ??
451 Set oObject = New Recordset
452 With DatabaseForm
453 oObject._CommandType = .CommandType
454 oObject._Command = .Command
455 oObject._ParentName = _Name
456 oObject._ParentType = _Type
457 Set oDatabase = Application._CurrentDb(_DocEntry, _DbEntry)
458 Set oObject._ParentDatabase = oDatabase
459 Set oObject._ParentDatabase.Connection = .ActiveConnection
460 oObject._ForwardOnly = ( .ResultSetType = com.sun.star.sdbc.ResultSetType.FORWARD_ONLY )
461 oObject._PassThrough = ( .EscapeProcessing = False )
462 oObject._ReadOnly = ( .ResultSetConcurrency = com.sun.star.sdbc.ResultSetConcurrency.READ_ONLY )
463 Call oObject._Initialize()
464 End With
465 With oDatabase
466 .RecordsetMax = .RecordsetMax + 1
467 oObject._Name = Format(.RecordsetMax, &quot;0000000&quot;)
468 .RecordsetsColl.Add(oObject, UCase(oObject._Name))
469 End With
470 Set _PropertyGet = oObject
471 Case UCase(&quot;RecordSource&quot;)
472 _PropertyGet = DatabaseForm.ActiveCommand
473 Case Else
474 Goto Trace_Error
475 End Select
477 Exit_Function:
478 Utils._ResetCalledSub(&quot;SubForm.get&quot; &amp; psProperty)
479 Exit Function
480 Trace_Error:
481 TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
482 _PropertyGet = vEMPTY
483 Goto Exit_Function
484 Trace_Error_Index:
485 TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
486 _PropertyGet = vEMPTY
487 Goto Exit_Function
488 Error_Function:
489 TraceError(TRACEABORT, Err, &quot;SubForm._PropertyGet&quot;, Erl)
490 _PropertyGet = vEMPTY
491 GoTo Exit_Function
492 End Function &apos; _PropertyGet
494 REM -----------------------------------------------------------------------------------------------------------------------
495 Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
497 Utils._SetCalledSub(&quot;SubForm.set&quot; &amp; psProperty)
498 If _ErrorHandler() Then On Local Error Goto Error_Function
499 _PropertySet = True
501 &apos;Execute
502 Dim iArgNr As Integer
504 If _IsLeft(_A2B_.CalledSub, &quot;SubForm.&quot;) Then iArgNr = 1 Else iArgNr = 2
505 Select Case UCase(psProperty)
506 Case UCase(&quot;AllowAdditions&quot;)
507 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
508 DatabaseForm.AllowInserts = pvValue
509 DatabaseForm.reload()
510 Case UCase(&quot;AllowDeletions&quot;)
511 If Not Utils._CheckArgument(pvValue,iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
512 DatabaseForm.AllowDeletes = pvValue
513 DatabaseForm.reload()
514 Case UCase(&quot;AllowEdits&quot;)
515 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
516 DatabaseForm.AllowUpdates = pvValue
517 DatabaseForm.reload()
518 Case UCase(&quot;CurrentRecord&quot;)
519 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
520 DatabaseForm.absolute(pvValue)
521 Case UCase(&quot;Filter&quot;)
522 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
523 DatabaseForm.Filter = Application._CurrentDb(_DocEntry, _DbEntry)._ReplaceSquareBrackets(pvValue)
524 Case UCase(&quot;FilterOn&quot;)
525 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
526 DatabaseForm.ApplyFilter = pvValue
527 DatabaseForm.reload()
528 Case UCase(&quot;OrderBy&quot;)
529 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
530 _OrderBy = Application._CurrentDb(_DocEntry, _DbEntry)._ReplaceSquareBrackets(pvValue)
531 Case UCase(&quot;OrderByOn&quot;)
532 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
533 If pvValue Then DatabaseForm.Order = _OrderBy Else DatabaseForm.Order = &quot;&quot;
534 DatabaseForm.reload()
535 Case UCase(&quot;RecordSource&quot;)
536 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
537 DatabaseForm.Command = Application._CurrentDb(_DocEntry, _DbEntry)._ReplaceSquareBrackets(pvValue)
538 DatabaseForm.CommandType = com.sun.star.sdb.CommandType.COMMAND
539 DatabaseForm.Filter = &quot;&quot;
540 DatabaseForm.reload()
541 Case Else
542 Goto Trace_Error
543 End Select
545 Exit_Function:
546 Utils._ResetCalledSub(&quot;SubForm.set&quot; &amp; psProperty)
547 Exit Function
548 Trace_Error:
549 TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
550 _PropertySet = False
551 Goto Exit_Function
552 Trace_Error_Value:
553 TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
554 _PropertySet = False
555 Goto Exit_Function
556 Error_Function:
557 TraceError(TRACEABORT, Err, &quot;SubForm._PropertySet&quot;, Erl)
558 _PropertySet = False
559 GoTo Exit_Function
560 End Function &apos; _PropertySet
561 </script:module>