How to automatically place cursor at start of field ?

General discussion on OpenOffice Base and its databases.

How to automatically place cursor at start of field ?

Postby Micheal T. Leo » Sat Jun 21, 2014 7:35 am

Hello,

How is it possible in Base to do the feat achievable in Access by placing the VBA script Me.[Field].SelStart = 0 in the "On Click" event of a given box?
I ask this because I've added a pattern field with a time-type input mask, i.e. __:__ and clicking it often places the selection in an inconvenient
position for data entry.

Thanks.
Micheal T. Leo
 
Posts: 26
Joined: Mon Mar 24, 2014 6:26 am

Re: How to automatically place cursor at start of field ?

Postby Tansenn » Sat Jun 21, 2014 10:41 am

Hi,

no problem:
Code: Select all
sub Onclick_patternfield(event)
    dim osel as new com.sun.star.awt.Selection
    osel.Max = 0
    osel.Min = 0
    ocontroller = thiscomponent.currentcontroller
    opatternfield = event.source.model
    opatternfieldcontrol = ocontroller.getcontrol(opatternfield)
    opatternfieldcontrol.selection = osel   
end sub

bound to the "mouse button released" event of the patternfield.
But i would enter the field by tabulator, and no macro is needed.

Hope this will help u.
Thanks,
Tansenn
 
Posts: 28
Joined: Tue Mar 25, 2014 6:27 am


Return to OpenOffice.org Base

Who is online

Users browsing this forum: No registered users and 1 guest

cron