summaryrefslogtreecommitdiffstats
path: root/source/text/sbasic/shared/03/sf_form.xhp
blob: 497b379e36f1e925eee13b3ca1230aa4cdec38d0 (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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * 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/.
 *
-->
<meta>
  <topic id="SF_Form" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">SFDocuments.Form service</title>
    <filename>/text/sbasic/shared/03/sf_form.xhp</filename>
  </topic>
  </meta>
<body>
<section id="ScriptForge-sf_form">
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id41582391760252">
      <bookmark_value>Form service</bookmark_value>
   </bookmark>
</section>
<section id="abstract">
  <h1 id="bm_id781582391760253" xml-lang="en-US"><variable id="FormService"><link href="text/sbasic/shared/03/sf_form.xhp" name="SFDocuments.Form"><literal>SFDocuments</literal>.<literal>Form</literal> service</link></variable></h1>
  <paragraph role="paragraph" id="par_id931583589764919" xml-lang="en-US">The <literal>Form</literal> service provides methods and properties to manage forms in %PRODUCTNAME documents. This service supports forms in Base, Calc and Writer documents and allows to:</paragraph>
  <list type="unordered">
    <listitem>
        <paragraph id="par_id381618172063851" role="listitem">Open and activate forms.</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id261618172129782" role="listitem">Navigate through records shown by the form.</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id281618172141607" role="listitem">Get access to the controls inside the form.</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id371618172155483" role="listitem">Get access to subforms of a parent form.</paragraph>
    </listitem>
  </list>
</section>
  <tip id="par_id351616768789190" xml-lang="en-US">The <literal>SFDocuments</literal>.<literal>Form</literal> service is available from %PRODUCTNAME 7.2 onwards.</tip>
  <paragraph role="paragraph" id="par_id451616765867881" xml-lang="en-US">Forms are usually used in %PRODUCTNAME documents to create user interfaces connected to relational databases. Hence, the <literal>Form</literal> service provides quick access to the linked database through the <link href="text/sbasic/shared/03/sf_database.xhp" name="SFDatabases.Database"><literal>SFDatabases</literal>.<literal>Database</literal> service</link>.</paragraph>
  <tip id="par_id891598188164936" xml-lang="en-US">The <literal>SFDocuments</literal>.<literal>Form</literal> service is closely related to the <link href="text/sbasic/shared/03/sf_formcontrol.xhp" name="SFDocuments.FormControl"><literal>SFDocuments</literal>.<literal>FormControl</literal> service.</link></tip>
  <h2 id="hd_id161616766330804" xml-lang="en-US">Definitions</h2>
  <h3 id="hd_id751616766382317" xml-lang="en-US" localize="false">FormDocument</h3>
  <paragraph role="paragraph" id="par_id951618172906010">Forms are usually created in Base documents, but they can be added to Writer and Calc documents as well.</paragraph>
  <paragraph role="paragraph" id="par_id671618173380680">In Base, each form you create using the <menuitem>Insert - Form</menuitem>  functionality or through the <link href="text/shared/autopi/01090000.xhp" name="FormWizard">Form Wizard</link> is actually a <literal>FormDocument</literal> that can be handled with the <literal>Form</literal> service. Base documents can contain an unlimited number of form documents.</paragraph>
  <paragraph role="paragraph" id="par_id841618177362626">Below is an example showing the hierarchy of all the elements involved in accessing forms and subforms in a Base document. Suppose you have a Base file named <literal>Employees.odb</literal> and inside it you created a form document to add new employees to the database. The form document contains a main form named <literal>EmployeeData</literal> that gives access to a table. There is also a subform <literal>WorksAtPlant</literal> that allows you to associate the new employee to one of the plants of the company.</paragraph>
  <bascode>
    <paragraph role="bascode" id="bas_id151618176848874">Employees.odb (Base document)</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id381618176868013"> |</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id351618176868854"> |-- AddEmployee (FormDocument)</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id211618176869166">      |</paragraph>
    <paragraph role="bascode" id="bas_id941618176869485">      |-- EmployeeData (Main Form)</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id571618176869726">           |</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id291618176869942">           |-- WorksAtPlant (SubForm)</paragraph>
  </bascode>
  <note id="par_id221618173444457">A <literal>FormDocument</literal> can be seen as a set of forms that provide access to datasets such as database tables and queries from within %PRODUCTNAME documents. The names of forms and subforms inside a FormDocument can be accessed using the <link href="text/shared/02/01170600.xhp" name="FormNavigator">Form Navigator</link>.</note>
  <h3 id="hd_id851616767037521" xml-lang="en-US">Forms and Subforms</h3>
  <paragraph role="paragraph" id="par_id681616767265034" xml-lang="en-US">A form document is composed of one or more forms which, in turn, may also contain any number of subforms. A Form is an abstract set of controls that are linked to a specified data source, which can be a database table, a query or a SQL <literal>SELECT</literal> statement.</paragraph>
  <paragraph role="paragraph" id="par_id711618178831976">In Calc and Writer documents, each form can be linked to datasets located in different databases. On the other hand, in Base documents the database contained in the document is common to all forms.</paragraph>
  <tip id="par_id191616837111507" xml-lang="en-US">To invoke the <literal>SFDocuments</literal>.<literal>Form</literal> service refer to the methods <literal>Forms()</literal>, <literal>FormDocuments()</literal> and <literal>OpenFormDocument()</literal> of the <link href="text/sbasic/shared/03/sf_document.xhp" name="SFDocuments"><literal>SFDocuments</literal>.<literal>Document</literal></link> service</tip>
<section id="serviceInvocation">
  <h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2>
  <h3 id="hd_id991618179698545">In Writer documents</h3>
  <paragraph role="paragraph" id="par_id51616767892693" xml-lang="en-US">The code snippet below shows how to access the form named <literal>Form1</literal> that is inside a Writer file:</paragraph>
  <bascode>
      <paragraph role="bascode" localize="false" id="bas_id471598171198389">Dim oDoc As Object, myForm As Object, ui as Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id561618179461775">Set ui = CreateScriptService("UI")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id611598171572062">Set oDoc = ui.OpenDocument("~/Documents/MyForm.odt")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id571598171205739">Set myForm = oDoc.Forms("Form1")</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id241622014444493">from scriptforge import CreateScriptService</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id391622014212514">svc = CreateScriptService('UI') </paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id891622014222625">doc = svc.OpenDocument('~/Documents/MyForm.odt')</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id931622014224129">my_form = doc.Forms('Form1')</paragraph>
   </pycode>
   <paragraph role="paragraph" id="par_id531618179517628">Forms can be accessed by their names or by their indices, as shown below:</paragraph>
   <bascode>
     <paragraph role="bascode" localize="false" id="bas_id991598171277414">Set myForm = oDoc.Forms(0)</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id691622014677169">my_form = doc.Forms(0)</paragraph>
   </pycode>
   <warning id="par_id181618250546617">If you try to access a <literal>FormDocument</literal> that is currently opened in <emph>Design Mode</emph> an exception will be raised.</warning>
  <h3 id="hd_id921618179792926">In Calc documents</h3>
   <paragraph role="paragraph" id="par_id481618179851104">A form in a Calc file must have a unique name inside its sheet. Hence, the <literal>Forms</literal> method requires two arguments, the first indicating the sheet name and the second specifying the form name.</paragraph>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id471598171198125">Dim oDoc As Object, myForm As Object, ui as Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id561618179462475">Set ui = CreateScriptService("UI")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id611598170362062">Set oDoc = ui.OpenDocument("~/Documents/MyForms.ods")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id571598171200339">Set myForm = oDoc.Forms("Sheet1", "Form1")</paragraph>
   </bascode>
   <paragraph role="paragraph" id="par_id51622028165429">This is achieved identically using Python:</paragraph>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id871622021672708">svc = CreateScriptService('UI')</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id671622021672931">doc = svc.OpenDocument('~/Documents/MyForms.ods')</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id301622021673180">my_form = doc.Forms('Sheet1', 'Form1')</paragraph>
   </pycode>
  <h3 id="hd_id201618180055756">In Base documents</h3>
   <paragraph role="paragraph" id="par_id711616768164987" xml-lang="en-US">A <literal>FormDocument</literal> inside a Base document is accessed by its name. The following example opens the form document named <literal>thisFormDocument</literal> and accesses the form <literal>MainForm</literal>:</paragraph>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id471598176518738">Dim oDb As Object, myForm As Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id271598171282891">Set oDb = CreateScriptService("SFDocuments.Document", ThisDatabaseDocument)</paragraph>
      <paragraph role="bascode" id="bas_id271598171225874">' The statement below is necessary only if the form hasn't been opened yet</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id551598171288547">oDb.OpenFormDocument("thisFormDocument")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id741598171294507">Set myForm = oDoc.Forms("thisFormDocument", "MainForm")</paragraph>
      <paragraph role="bascode" id="bas_id51616768358888">' Or, alternatively, to access the form by its index ...</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id591598171300285">Set myForm = oDb.Forms("thisFormDocument", 0)</paragraph>
   </bascode>
   <note id="par_id991618249636036">To perform any action on a form using the <literal>Form</literal> service, the <literal>FormDocument</literal> must have been opened either manually by the user or programmatically in a user script. The latter can be done by calling the <literal>OpenFormDocument</literal> method of the <link href="text/sbasic/shared/03/sf_base.xhp" name="ScriptForge Base Service"><literal>Base</literal> service</link>.</note>
   <paragraph role="paragraph" id="par_id11618180564274">To access a given subform of a form use the <literal>SubForms</literal> method. Note that in the example below <literal>mySubForm</literal> is a new instance of the <literal>Form</literal> service.</paragraph>
   <bascode>
     <paragraph role="bascode" localize="false" id="bas_id71618182658792">Dim mySubForm As Object</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id681616768495330">Set mySubForm = myForm.SubForms("mySubForm")</paragraph>
   </bascode>
   <paragraph role="paragraph" id="par_id681622028653480">Previous examples translate in Python as:</paragraph>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id501622028742999">db = CreateScriptService('SFDocuments.Document', XSCRIPTCONTEXT.getDocument())</paragraph>
     <paragraph role="pycode" id="pyc_id811622808499801">#  The statement below is necessary only if the form hasn't been opened yet</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id671622028743191">form_doc = db.OpenFormDocument('thisFormDocument')</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id431622028743374">form = form_doc.Forms('thisFormDocument', 'MainForm')</paragraph>
     <paragraph role="pycode" id="pyc_id511622808538351">#  Or, alternatively, to access the form by its index ...</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id681622028743582">form = form_doc.Forms('thisFormDocument', 0)</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id611622028743782">sub_form = form.SubForms('mySubForm')</paragraph>
   </pycode>
  <h3 id="hd_id211618180379064">In Form events</h3>
   <paragraph role="paragraph" id="par_id421616768529754" xml-lang="en-US">To invoke the <literal>Form</literal> service when a form event takes place:</paragraph>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id931616768628138">Sub OnEvent(ByRef poEvent As Object)</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id931616768621093">    Dim myForm As Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id271616768613253">    Set myForm = CreateScriptService("SFDocuments.FormEvent", poEvent)</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id1001618180405172">    '(...)</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id751618180415566">End sub</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id551622022387877">def OnEvent(event: uno):</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id081622022388165">    form = CreateScriptService('SFDocuments.FormEvent', event)</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id641622022388397">    pass</paragraph>
   </pycode>
   <embed href="text/sbasic/shared/03/sf_formcontrol.xhp#FormEvent_Note"/>
   <paragraph role="paragraph" id="par_id721623150543016">It is recommended to free resources after use of the Form service.</paragraph>
   <bascode>
     <paragraph role="bascode" localize="false" id="bas_id751681880415566">myForm.Dispose() ' Basic</paragraph>
   </bascode>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id551226022387877">form.Dispose()  # Python</paragraph>
   </pycode>
   <paragraph role="paragraph" id="par_id221623150547406">This operation is done implicitly when a form document is closed with the <literal>CloseFormDocument()</literal> method described below.</paragraph>
</section>
  <h2 id="hd_id651583668365757" xml-lang="en-US">Properties</h2>
   <table id="tab_id381583668386455">
      <tablerow>
         <tablecell>
            <paragraph id="par_id871583668386455" role="tablehead" xml-lang="en-US">Name</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id491583668386455" role="tablehead" xml-lang="en-US">Readonly</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id271583668474014" role="tablehead" xml-lang="en-US">Type</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id401583668386455" role="tablehead" xml-lang="en-US">Description</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id151583668386455" role="tablecontent" localize="false">AllowDeletes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id371583668519172" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id271583668386455" role="tablecontent" localize="false">Boolean</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id771583668386455" role="tablecontent" xml-lang="en-US">Specifies if the form allows to delete records.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id951583839708571" role="tablecontent" localize="false">AllowInserts</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id541583839708548" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id751583839708362" role="tablecontent" localize="false">Boolean</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id731583839708412" role="tablecontent" xml-lang="en-US">Specifies if the form allows to add records.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id511584027709311" role="tablecontent" localize="false">AllowUpdates</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id761584027709516" role="tablecontent " xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id491584027709825" role="tablecontent" localize="false">Boolean</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id971584027709752" role="tablecontent" xml-lang="en-US">Specifies if the form allows to update records.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id491583839767611" role="tablecontent" localize="false">BaseForm</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id31583839767743" role="tablecontent " xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id741583839767926" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id111583839767195" role="tablecontent" xml-lang="en-US">Specifies the hierarchical name of the Base Form containing the actual form.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id83158383992056" role="tablecontent" localize="false">Bookmark</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id771583839920487" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id971583839920282" role="tablecontent" localize="false">Variant</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id451583839920858" role="tablecontent" xml-lang="en-US">Specifies uniquely the current record of the form's underlying table, query or SQL statement.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id751588333908795" role="tablecontent" localize="false">CurrentRecord</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id571588333908716" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id781588333908500" role="tablecontent" localize="false">Long</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id721588333908708" role="tablecontent" xml-lang="en-US">Identifies the current record in the dataset being viewed on a form. If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. Row count starts at 1. If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. Row -1 refers to the last row in the result set.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id251583774433989" role="tablecontent" localize="false">Filter</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id501583774433513" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id411583774433779" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph role="paragraph" id="par_id151598177605296" xml-lang="en-US">Specifies a subset of records to be displayed as a <literal>SQL</literal> <literal>WHERE</literal>-clause without the <literal>WHERE</literal> keyword.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id731588334016220" role="tablecontent" localize="false">LinkChildFields</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id271588334016191" role="tablecontent" xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id991588334016273" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id251588334016874" role="tablecontent" xml-lang="en-US">Specifies how records in a child subform are linked to records in its parent form.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id881616774153888" role="tablecontent" localize="false">LinkParentFields</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id901616774153495" role="tablecontent" xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id981616774153884" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id981616774153723" role="tablecontent" xml-lang="en-US">Specifies how records in a child subform are linked to records in its parent form.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id561616774304843" role="tablecontent" localize="false">Name</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id501616774304840" role="tablecontent" xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id71616774304482" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id461616774304497" role="tablecontent" xml-lang="en-US">The name of the current form.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id331616774384380" role="tablecontent" localize="false">OrderBy</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id751616774384451" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id641616774384366" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id321616774384489" role="tablecontent" xml-lang="en-US">Specifies in which order the records should be displayed as a <literal>SQL</literal> <literal>ORDER BY</literal> clause without the <literal>ORDER BY</literal> keywords.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id281616774918384" role="tablecontent" localize="false">Parent</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id261616774918923" role="tablecontent" xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id861616774918694" role="tablecontent" localize="false">Object</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id171616774918881" role="tablecontent" xml-lang="en-US">The parent of the current form. It can be either a <literal>SFDocuments</literal>.<literal>Form</literal> or a <literal>SFDocuments</literal>.<literal>Document</literal> object.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id581616777650809" role="tablecontent" localize="false">RecordSource</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id501616777650751" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id991616777650362" role="tablecontent" localize="false">String</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id91616777650933" role="tablecontent" xml-lang="en-US">Specifies the source of the data, as a table name, a query name or a SQL statement.</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id741598177924441" role="tablecontent" localize="false">XForm</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id451598177924437" role="tablecontent" xml-lang="en-US">Yes</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id94159817792441" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id191598177924897" role="tablecontent" xml-lang="en-US">The UNO object representing interactions with the form. Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1form_1_1XForm.html" name="XForm interface">XForm</link> and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1form_1_1component_1_1DataForm.html" name="DataForm service">DataForm</link> in the API documentation for detailed information.</paragraph>
         </tablecell>
      </tablerow>
   </table>
   <h2 id="hd_id421612628828054" xml-lang="en-US">Event properties</h2>
   <paragraph role="paragraph" id="par_id41612629140856" xml-lang="en-US">The properties below return or set URI strings that define the script triggered by the event.</paragraph>
   <table id="tab_id951612628879819">
      <tablerow>
         <tablecell>
            <paragraph id="par_id961612628879819" role="tablehead" xml-lang="en-US">Name</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id401612628879819" role="tablehead" xml-lang="en-US">ReadOnly</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id281612628879819" role="tablehead" xml-lang="en-US">Basic IDE Description</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id431612629836735" localize="false" role="tablecontent" xml-lang="en-US">OnApproveCursorMove</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id111612629836630" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id1001612629836902" role="tablecontent" xml-lang="en-US">Before record change</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id701612629836389" localize="false" role="tablecontent" xml-lang="en-US">OnApproveParameter</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id291612629836294" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id62161262983683" role="tablecontent" xml-lang="en-US">Fill parameters</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id241612629836863" localize="false" role="tablecontent" xml-lang="en-US">OnApproveReset</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id81612629836634" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id881612629836744" role="tablecontent" xml-lang="en-US">Prior to reset</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id201612629836996" localize="false" role="tablecontent" xml-lang="en-US">OnApproveRowChange</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id591612629836830" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id161612629836775" role="tablecontent" xml-lang="en-US">Before record action</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id111612629836950" localize="false" role="tablecontent" xml-lang="en-US">OnApproveSubmit</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id891612629836630" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id461612629836679" role="tablecontent" xml-lang="en-US">Before submitting</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id711612629836495" localize="false" role="tablecontent" xml-lang="en-US">OnConfirmDelete</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id131612629836291" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id151612629836151" role="tablecontent" xml-lang="en-US">Confirm deletion</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id971612629836286" localize="false" role="tablecontent" xml-lang="en-US">OnCursorMoved</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id211612629836725" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id361612629836624" role="tablecontent" xml-lang="en-US">After record change</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id721612629836537" localize="false" role="tablecontent" xml-lang="en-US">OnErrorOccurred</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id311612629836481" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id721612629836752" role="tablecontent" xml-lang="en-US">Error occurred</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id55161262983695" localize="false" role="tablecontent" xml-lang="en-US">OnLoaded</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id981612629836116" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id381612629836635" role="tablecontent" xml-lang="en-US">When loading</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id621612629836155" localize="false" role="tablecontent" xml-lang="en-US">OnReloaded</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id711612629836704" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id35161262983642" role="tablecontent" xml-lang="en-US">When reloading</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id541616778783953" localize="false" role="tablecontent" xml-lang="en-US">OnReloading</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id44161677878329" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id661616778783899" role="tablecontent" xml-lang="en-US">Before reloading</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id961616778529182" localize="false" role="tablecontent" xml-lang="en-US">OnResetted</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id651616778529764" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id311616778529570" role="tablecontent" xml-lang="en-US">After resetting</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id171616778529918" localize="false" role="tablecontent" xml-lang="en-US">OnRowChanged</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id601616778529481" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id351616778529352" role="tablecontent" xml-lang="en-US">After record action</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id91616778529622" localize="false" role="tablecontent" xml-lang="en-US">OnUnloaded</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id711616778529292" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id981616778529250" role="tablecontent" xml-lang="en-US">When unloading</paragraph>
         </tablecell>
      </tablerow>
      <tablerow>
         <tablecell>
            <paragraph id="par_id71616778529970" localize="false" role="tablecontent" xml-lang="en-US">OnUnloading</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id521616778529932" role="tablecontent" xml-lang="en-US">No</paragraph>
         </tablecell>
         <tablecell>
            <paragraph id="par_id511616778529291" role="tablecontent" xml-lang="en-US">Before unloading</paragraph>
         </tablecell>
      </tablerow>
   </table>
   <tip id="par_id961618181634322">To learn more about URI strings, refer to the <link href="https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Scripting_Framework_URI_Specification" name="URI specification">Scripting Framework URI Specification</link>.</tip>
   <table id="tab_id891606472825856">
    <tablerow>
       <tablecell colspan="3"><paragraph id="par_id921606472825856" role="tablehead">List of methods in the Form service</paragraph></tablecell>
    </tablerow>
    <tablerow>
       <tablecell><paragraph id="par_id381606472825856" role="tablecontent" localize="false">
           <link href="text/sbasic/shared/03/sf_form.xhp#Activate" name="Activate method">Activate</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#CloseFormDocument" name="CloseFormDocument method">CloseFormDocument</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#Controls" name="Controls method">Controls</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#GetDatabase" name="GetDatabase method">GetDatabase</link><br/>
       </paragraph></tablecell>
       <tablecell><paragraph id="par_id451606472825856" role="tablecontent" localize="false">
           <link href="text/sbasic/shared/03/sf_form.xhp#MoveFirst" name="MoveFirst method">MoveFirst</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#MoveLast" name="MoveLast method">MoveLast</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#MoveNext" name="MoveNext method">MoveNext</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#MoveNew" name="MoveNew method">MoveNew</link><br/>
       </paragraph></tablecell>
       <tablecell><paragraph id="par_id161606472825856" role="tablecontent" localize="false">
           <link href="text/sbasic/shared/03/sf_form.xhp#MovePrevious" name="MovePrevious method">MovePrevious</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#Requery" name="Requery method">Requery</link><br/>
           <link href="text/sbasic/shared/03/sf_form.xhp#Subforms" name="Subforms method">SubForms</link><br/><br/>
       </paragraph></tablecell>
    </tablerow>
    </table>
<section id="Activate">
  <comment> Activate -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id721583933076548">
      <bookmark_value>Form service;Activate</bookmark_value>
   </bookmark>
   <h2 id="hd _id681583933076692" localize="false">Activate</h2>
   <paragraph role="paragraph" id="par_id871583933076448">Sets the focus on the current <literal>Form</literal> instance. Returns <literal>True</literal> if focusing was successful.</paragraph>
   <paragraph role="paragraph" id="par_id81616858956290" xml-lang="en-US">The behavior of the <literal>Activate</literal> method depends on the type of document where the form is located:</paragraph>
   <list type="unordered">
      <listitem>
         <paragraph id="par_id761616858967361"  role="listitem" xml-lang="en-US"><emph>In Writer documents:</emph> Sets the focus on that document.</paragraph>
      </listitem>
      <listitem>
         <paragraph id="par_id931616859010103"  role="listitem" xml-lang="en-US"><emph>In Calc documents:</emph> Sets the focus on the sheet to which the form belongs.</paragraph>
      </listitem>
      <listitem>
         <paragraph id="par_id41616859019478"  role="listitem" xml-lang="en-US"><emph>In Base documents:</emph> Sets the focus on the <literal>FormDocument</literal> the <literal>Form</literal> refers to.</paragraph>
      </listitem>
   </list>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id11622536171845" localize="false"><input>svc.Activate(): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <paragraph role="paragraph" id="par_id921618228229529">The following example assumes you want to activate the form named <literal>FormA</literal> located in <literal>Sheet1</literal> of the currently open Calc file. It first gets access to the document using the <literal>Document</literal> service and <literal>ThisComponent</literal> and then activates the form.</paragraph>
   <bascode>
     <paragraph role="bascode" id="bas_id21618228468066">'Gets hold of the form that will be activated</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id421618228118346">Dim oDoc as Object, myForm as Object</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id261618228156375">Set oDoc = CreateScriptService("Document", ThisComponent)</paragraph>
     <paragraph role="paragraph" localize="false" id="par_id451618228193979">Set myForm = oDoc.Forms("Sheet1", "FormA")</paragraph>
     <paragraph role="bascode" id="bas_id201618228487565">'Activates the form</paragraph>
     <paragraph role="bascode" localize="false" id="bas_id361598179135096">myForm.Activate()</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
     <paragraph role="pycode" localize="false" id="pyc_id211622537233877">doc = CreateScriptService('Document', XSCRIPTCONTEXT.getDocument())</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id181622537234494">form = doc.Forms('Sheet1', 'FormA')</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id981622537234703">form.Activate()</paragraph>
   </pycode>
  <note id="par_id81618228720782"><literal>ThisComponent</literal> applies to Calc and Writer documents. For Base documents use <literal>ThisDataBaseDocument</literal>.</note>
</section>
<section id="CloseFormDocument">
  <comment> CloseFormDocument -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id14161686043795">
      <bookmark_value>Form service;CloseFormDocument</bookmark_value>
   </bookmark>
   <h2 id="hd _id18161686043718" localize="false">CloseFormDocument</h2>
   <paragraph role="paragraph" id="par_id501616860541195" xml-lang="en-US">Closes the form document containing the actual <literal>Form</literal> instance. The <literal>Form</literal> instance is disposed.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id811622538068303" localize="false"><input>svc.CloseFormDocument(): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id511616860437148">myForm.CloseFormDocument() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id331622538021746">form.CloseFormDocument()  # Python</paragraph>
   </pycode>
   <note id="par_id611618229004669">This method only closes form documents located in Base documents. If the form is stored in a Writer or Calc document, calling <literal>CloseFormDocument</literal> will have no effect.</note>
</section>
<section id="Controls">
   <comment> Controls -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id41584541257826">
      <bookmark_value>Form service;Controls</bookmark_value>
   </bookmark>
   <h2 id="hd _id95158454125767" localize="false">Controls</h2>
   <paragraph role="paragraph" id="par_id161584541257982">The value returned by the <literal>Controls</literal> method depends on the arguments provided:</paragraph>
   <list type="unordered">
      <listitem>
         <paragraph id="par_id421598179770993"  role="listitem" xml-lang="en-US">If the method is called <emph>without arguments</emph>, then it returns the list of the controls contained in the form. Beware that the returned list does not contain any subform controls.</paragraph>
      </listitem>
      <listitem>
         <paragraph id="par_id81598185229301"  role="listitem" xml-lang="en-US">If the optional <literal>ControlName</literal> argument is provided, the method returns a <literal>FormControl</literal> class instance referring to the specified control.</paragraph>
      </listitem>
   </list>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id471622538274231" localize="false"><input>svc.Controls(opt controlname: str): any</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id1001584541257789"><emph>controlname</emph> : A valid control name as a case-sensitive string. If absent, the list of control names is returned as a zero-based array.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id151598185478904">Dim myForm As Object, myList As Variant, myControl As Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id21598185484092">Set myForm = myDoc.Forms("myForm")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id641598185489492">myList = myform.Controls()</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id921598185495193">Set myControl = myform.Controls("myTextBox") ' SFDocuments.FormControl</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id711622538462214">form = doc.Forms('myForm')</paragraph>
      <paragraph role="pycode" localize="false" id="pyc_id631622538462782">form_names = form.Controls()</paragraph>
      <paragraph role="pycode" localize="false" id="pyc_id961622538463294">form_control = form.Controls('myTextBox')  # SFDocuments.FormControl</paragraph>
   </pycode>
</section>
<section id="GetDatabase">
   <comment> GetDatabase -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id941616861134691">
      <bookmark_value>Form service;GetDatabase</bookmark_value>
   </bookmark>
   <h2 id="hd _id141616861134554" localize="false">GetDatabase</h2>
   <paragraph role="paragraph" id="par_id291616861407907" xml-lang="en-US">Return a <link href="text/sbasic/shared/03/sf_database.xhp" name="DBService"><literal>SFDatabases</literal>.<literal>Database</literal></link> instance giving access to the execution of SQL commands on the database the current form is connected to and/or that is stored in the current Base document.</paragraph>
   <paragraph role="paragraph" id="par_id991616861417207" xml-lang="en-US">Each form has its own database connection, except in Base documents where they all share the same connection.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id221622547947693" localize="false"><input>svc.GetDatabase(opt user: str, opt password: str): svc</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id701616861134906"><emph>user, password</emph>: The login optional parameters (Default = "").</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id231616861134373">Dim myDb As Object ' SFDatabases.Database</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id2316168611347">Set myDb = oForm.GetDatabase()</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id871622547824003">db = form.GetDatabase()  # SFDatabases.Database</paragraph>
   </pycode>
</section>
<section id="MoveFirst">
  <comment> MoveFirst -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id671616861787529">
      <bookmark_value>Form service;MoveFirst</bookmark_value>
   </bookmark>
   <h2 id="hd _id591616861787279" localize="false">MoveFirst</h2>
   <paragraph role="paragraph" id="par_id771616861842867" xml-lang="en-US">The form cursor is positioned on the first record. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id101622549004980" localize="false"><input>svc.MoveFirst(): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id191616861787635">myForm.MoveFirst() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id421622549258920">form.MoveFirst()  # Python</paragraph>
   </pycode>
</section>
<section id="MoveLast">
  <comment> MoveLast -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id551616863143388">
      <bookmark_value>Form service;MoveLast</bookmark_value>
   </bookmark>
   <h2 id="hd _id831616863143434" localize="false">MoveLast</h2>
   <paragraph role="paragraph" id="par_id331616863143187" xml-lang="en-US">The form cursor is positioned on the last record. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id931622549019307" localize="false"><input>svc.MoveLast(): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id691616863143688">myForm.MoveLast() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id831622549604397">form.MoveLast()  # Python</paragraph>
   </pycode>
</section>
<section id="MoveNew">
  <comment> MoveNew -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id231616863143638">
      <bookmark_value>Form service;MoveNew</bookmark_value>
   </bookmark>
   <h2 id="hd _id41161686314366" localize="false">MoveNew</h2>
   <paragraph role="paragraph" id="par_id361616863143954" xml-lang="en-US">The form cursor is positioned on the new record area. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id131622549039501" localize="false"><input>svc.MoveNew(): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id401616863143757">myForm.MoveNew() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id381622549678558">form.MoveNew()  # Python</paragraph>
   </pycode>
</section>
<section id="MoveNext">
  <comment> MoveNext -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id171616863143921">
      <bookmark_value>Form service;MoveNext</bookmark_value>
   </bookmark>
   <h2 id="hd _id111616863143256" localize="false">MoveNext</h2>
   <paragraph role="paragraph" id="par_id541616863143461" xml-lang="en-US">The form cursor is positioned on the next record. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id291622549045804" localize="false"><input>svc.MoveNext(opt offset: int): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id271616863582607"><emph>offset</emph>: The number of records to go forward (Default = 1).</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id591616863143862">myForm.MoveNext() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id361622549859524">form.MoveNext()  # Python</paragraph>
   </pycode>
</section>
<section id="MovePrevious">
  <comment> MovePrevious -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id71161686379488">
      <bookmark_value>Form service;MovePrevious</bookmark_value>
   </bookmark>
   <h2 id="hd _id371616863794447" localize="false">MovePrevious</h2>
   <paragraph role="paragraph" id="par_id616168637945" xml-lang="en-US">The form cursor is positioned on the previous record. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" id="par_id981622549054028" localize="false"><input>svc.MovePrevious(opt offset: int): bool</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id751616863794125"><emph>offset</emph>: The number of records to go backwards (Default = 1).</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id941616863794988">myForm.MovePrevious() ' Basic</paragraph>
   </bascode>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id221622549920933">form.MovePrevious()  # Python</paragraph>
   </pycode>
</section>
<section id="Requery">
  <comment> Requery -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id741616864216894">
      <bookmark_value>Form service;Requery</bookmark_value>
   </bookmark>
   <h2 id="hd _id551616864216705" localize="false">Requery</h2>
   <paragraph role="paragraph" id="par_id811616864216529" xml-lang="en-US">Reloads the current data from the database and refreshes the form. The cursor is positioned on the first record. Returns <literal>True</literal> if successful.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" localize="false" id="par_id731622550132517">svc.Requery(): bool</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id211616864216116">myForm.Requery() ' Basic</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id401622550186725">form.Requery()  # Python</paragraph>
   </pycode>
</section>
<section id="Subforms">
   <comment> Subforms -------------------------------------------------------------------------------------------------------------------------- </comment>
   <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id441616864510542">
      <bookmark_value>Form service;Subforms</bookmark_value>
   </bookmark>
   <h2 id="hd _id241616864510145" localize="false">Subforms</h2>
   <paragraph role="paragraph" id="par_id891616864510614">The value returned by the <literal>Subforms</literal> method depends on the arguments provided:</paragraph>
   <list type="unordered">
      <listitem>
         <paragraph id="par_id951616864510585"  role="listitem" xml-lang="en-US">If the method is called <emph>without any arguments</emph>, then it returns the list of subforms contained in the current form or subform instance.</paragraph>
      </listitem>
      <listitem>
         <paragraph id="par_id591616864510445" role="listitem" xml-lang="en-US">If the optional <literal>subform</literal> argument is provided, the method returns a new <literal>SFDocuments</literal>.<literal>Form</literal> instance based on the specified form/subform name or index.</paragraph>
      </listitem>
   </list>
   <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
   <paragraph role="paragraph" localize="false" id="par_id541622550497960"><input>svc.Subforms(): str[0..*]</input></paragraph>
   <paragraph role="paragraph" localize="false" id="par_id161623413158150"><input>svc.Subforms(subform: str): svc</input></paragraph>
   <paragraph role="paragraph" localize="false" id="par_id31623413181836"><input>svc.Subforms(subform: int): svc</input></paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
   <paragraph role="paragraph" id="par_id341616864510747"><emph>subform</emph>: A subform stored in the current <literal>Form</literal> class instance given by its name or index.</paragraph>
   <paragraph role="paragraph" id="par_id211618230389251">When this argument is absent, the method returns a list of available subforms as a zero-based array. If the form has a single subform, you can set <literal>subform = 0</literal> to get access to it.</paragraph>
   <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
   <bascode>
      <paragraph role="bascode" localize="false" id="bas_id821616864510402">Dim myForm As Object, myList As Variant, mySubform As Object</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id81616864510872">myList = myform.Subforms()</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id951616864510420">Set mySubform = myForm.Subforms("mySubform") ' SFDocuments.Form</paragraph>
   </bascode>
   <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
   <pycode>
      <paragraph role="pycode" localize="false" id="pyc_id101622552303831">subform_names = form.Subforms()</paragraph>
     <paragraph role="pycode" localize="false" id="pyc_id781622552304561">subform = form.Subforms('mySubform')  # SFDocuments.Form</paragraph>
   </pycode>
</section>
   <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
   <section id="relatedtopics">
      <embed href="text/sbasic/shared/03/sf_database.xhp#DatabaseService"/>
      <embed href="text/sbasic/shared/03/sf_document.xhp#DocumentService"/>
      <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
   </section>
</body>
</helpdocument>