[Solved] Contents selected when tabbing to form field

Discuss the database features
Post Reply
intruder6
Posts: 3
Joined: Fri Jun 15, 2018 8:18 pm

[Solved] Contents selected when tabbing to form field

Post by intruder6 »

I transferred a simple Microsoft Access database to OO Base and created a form (my first use of Base). In Access, there is an option to control the behaviour when tabbing to a control: select contents, place cursor at beginning of contents, place cursor at end of contents.

In my OO form, the contents are always selected when the cursor moves to a control.

How can I replicate the Access behaviour?
Last edited by intruder6 on Mon Jun 18, 2018 8:09 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 8.1.
UnklDonald418
Volunteer
Posts: 1544
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Contents selected when tabbing to form field

Post by UnklDonald418 »

Base is a front end for the HSQL database engine and IS NOT an MS Access clone. I believe OpenOffice was originally intended to compete with MS Office, but it evolved down a very different path. OpenOffice Base has seen very little development since 2008. The LibreOffice offshoot has seen a little more, but so far it has mostly been cosmetic with a few bug fixes.
The default Embedded database supplied with Base is locked in to HSQLDB version 1.8 which is also 10 years old. More recent versions of HSQLDB are available when using a Split database model.
[Wizard] Create a new 'split' HSQL 2.x database
or
[Tutorial] Splitting an "embedded HSQL database"
Base does not have the options you are asking about, so after tabbing to a form control the user needs to press either Home or End to place the cursor at those locations.
What you are looking for might be achievable using macro code.
The following code seems to work when invoked by the When receiving focus event. It has been tested only on Text Box and Formatted Field controls.

Code: Select all

REM  *****  BASIC  *****

Sub SetCursorLeft (oEvent as object)
Dim oSel

'If Not Globalscope.BasicLibraries.isLibraryLoaded("MRILib") Then
'      Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
'End If
'Dim oMRI as object
'oMRI = CreateUnoService( "mytools.Mri" )

'oMRI.inspect oEvent

oSel= createObject("com.sun.star.awt.Selection")
oSel = oEvent.Source.getSelection()
oSel.Min = 0
oSel.Max = 0
oEvent.Source.setSelection(oSel)

End Sub

Sub SetCursorRight (oEvent as object)
Dim oSel

oSel= createObject("com.sun.star.awt.Selection")
oSel = oEvent.Source.getSelection()
oSel.Min = oSel.Max
oEvent.Source.setSelection(oSel)

End Sub
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
intruder6
Posts: 3
Joined: Fri Jun 15, 2018 8:18 pm

Re: Contents selected when tabbing to form field

Post by intruder6 »

Thank you for your suggestion. I will implement it and confirm that it works for all the fields.
OpenOffice 4.1.5 on Windows 8.1.
intruder6
Posts: 3
Joined: Fri Jun 15, 2018 8:18 pm

Re: Contents selected when tabbing to form field

Post by intruder6 »

I have implemented the macros and everything works just fine.

I have taken note of the fact that there has been little development for 10 years.

Thank you for your help.
OpenOffice 4.1.5 on Windows 8.1.
Post Reply