Two navigation bars, one for the MainForm and the other to the SubForm

Sup, I have this form where I have a MainForm and SubForm, I want a way to have separate navigation bars for each one of them.

I have two of this personalized nav bar:

One of them is inside the MainForm, and the other one is inside the SubForm, but this is not enough, because the two of them can control any form I’ve interacted last with, I need a way that the first nav bar interacts only with the mainform, and the second with the subform, but I didnt find any easy way to do it, thanks everyone.

I discovered that the problem is in the image buttons that Im using, if I use regular buttons this works the way I want, but it would be really better if i can use the image buttons.

Might be I haven’t understand right:
You have added by Form → Navigation Bar a navigation bar to MainForm. You could see this in Form Navigator positioned in MainForm.
This navigation bar will navigate through MainForm and depending of the content of MainForm the content of SubForm will be changed. SubForm is directly connected to MainForm.
If you create a navigation bar in SubForm it will only navigate through the content of SubForm. It won’t change the content of MainForm.

1 Like

I think the problem is in the macros Im using, the same macros are being applied to the two nav bars, even though theyre in separated forms in the form navigator.

This is the one thats on the next register button (the third one):

sub NextRegister
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:NextRecord", "", 0, Array())



end sub

What do you do with macros there? If you will create a button, which should move to next record, you could chose this action for this button.
If you use graphical controls instead you could chose the action “open Document/Website” (hope it is right in English) and write as path .uno:NextRecord .

I tried it, but it still changes the main form, and not the subform, it just changes the subform after I interact with it.

Might be you could attach the database here (without personal data).
Might be a screenshot of FormNavigator with MainForm and SubForm opened and Buttons named helps also.

These are whats inside the MainForm, but whats important here is the 9 buttons, these need to control the MainForm


image

This subform isnt really relevant, because it is just for viewing
image

This is the subform where I have the second nav bar (b1-b9), I need it to control an image control that is linked to another table
image

I discovered that the problem is in the image buttons that Im using, if I use regular buttons this works the way I want, but it would be really better if i can use the image buttons.

In this case the solution is just to abandon the image buttons and switch to the regular ones, I searched for any bug reports and I found that this is happening since 2012. Its just some visual change, but image buttons should work properly I guess.

Image buttons never worked together with the default events. It’s a bug started in OpenOffice: Bug 46579.

But starting the default events by “Open document/web page” and then type for URL .uno:NextRecord should work.