Ask Your Question
0

In Base, how do you make navigation button that goes to a place within the same form?

asked 2015-11-07 02:15:44 +0100

gugglebun gravatar image

I am making a data entry form that's got some different sections on it. I would like to make up some navigation buttons (a switchboard type thing) that will jump the user to a specific section that's further down the same form, so they don't have to scroll. I "could" make the sections different forms, but I'd rather it be all on the one form. Is this possible and, if so, how is it done?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2015-11-12 08:21:30 +0100

pierre-yves samyn gravatar image

Hi

If the form contains sections you do not need macros. You can insert hyperlink buttons to sections: Insert Hyperlink, on the left select Document, click the Target button, select the section target, select form Button, give the text you want as label.

screenshot

See this example: Sections.odb

Note: it will change the anchor of the button to be able to move it (e.g. anchor page).

Regards

edit flag offensive delete link more
0

answered 2015-11-12 02:15:30 +0100

doug gravatar image

The simplest way to do this is just to move the focus to the first control in the section, or to the last and then first control in a manner that makes the screen scroll as desired. In the example below, the third indexed control is near the bottom of the form, and the second (actually, a button) is at the top of the section. This makes the screen go to the right place.

Sub ChangeFocus

root_doc = ThisComponent
drw = ThisComponent.DrawPage
form_container = drw.Forms
main_form = form_container.getByIndex(0)
ctrl = main_form.getByIndex(3)
butn = main_form.getByIndex(2)

cntrllr = ThisComponent.getCurrentController

cntrllr.getControl(ctrl).SetFocus()
cntrllr.getControl(butn).SetFocus()
End Sub

It probably also is possible to manually set the scroll level, but that would be difficult to maintain because the forms also have a zoom level and so the amount of the scroll that is necessary could change.

Hope this helps.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-11-07 02:15:44 +0100

Seen: 143 times

Last updated: Nov 12 '15