Page 1 of 1

[Solved] Use Forms with access2base

Posted: Fri Sep 16, 2016 1:57 am
by Ramon52
I'm introducing to LibreOffice Basic and acces2base.
Libre Office 5.1.5, Windows 7
After opening a form (with OpenForm), how to pause the program for let the user enter data? What property or method should I use?
I'm stopped with this question and I don't find any clear explanations or examples. Can you help me, please?
Thank you

Re: Use Forms with access2base

Posted: Fri Sep 16, 2016 1:37 pm
by Villeroy
A form is an office document (text document in most cases) with a hierarchy of logical forms and subforms with form controls where you insert, edit or delete records until you close the form document.
Dialogs serve different purposes. You can not edit database records through dialogs.

Re: Use Forms with access2base

Posted: Fri Sep 16, 2016 4:04 pm
by Ramon52
Thanks for the reply. My problem is that the following program is running in a single pull up at the end, without a pause to allow the user to enter data in the form. Any property or method is omitted?

Code: Select all

Sub StartMacroRemesa
	Dim ofRemesa as object, orsRemesa as object
	ofRemesa=OpenForm("Remesa",acNormal,,,acFormEdit,0)
	orsRemesa=ofRemesa.Recordset
	orsRemesa.Edit
	ofRemesa.SetFocus
	ofRemesa.Requery
'	StartMacro("export")
End Sub

Re: Use Forms with access2base

Posted: Fri Sep 16, 2016 4:17 pm
by JPL
Hi Ramon52,

there seems to exist a fundamental misunderstanding in how Basic procedures are triggered.
They are most of the time triggered by an EVENT, i.e. a click on a button, a jump to next record, a focus change, whatever ...

Additionally the procedure will not stop nor give the user the opportunity to react until the execution reaches the End Sub (or End Function) statement.

The OpenForm method will indeed open the desired form. If the user should then enter data, the statement containing OpenForm should be (one of) the last executable statements.

JPL

[Solved]Re: Use Forms with access2base

Posted: Mon Sep 19, 2016 2:12 pm
by Ramon52
Now I see it, is quite logical. Thank you very much.