Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the order of open "tabbed forms" in MS Access via VBA

I am using "tabbed document" forms in MS Access (each main form that is open has a "tab" to allow users to easily move between forms).

Does anyone know of a way to reorder such opened forms via VBA? I have workaround code that closes all the forms and then re-opens them in the order I need, but it is clunky and slow (some of the forms are big so take a while to load, and often users have applied filters/sorts which I then need to individually re-apply, plus resetting the current record etc etc).

As all I need is to change the order of the forms on-screen, so my approach seems like overkill - but I can't seem to find info on how to do this anywhere!

(FYI I am NOT talking about the order of pages within a tab control, to avoid any confusion!)

Please attached screenshot with three tabbed forms open, I'd like to re-arrange them so eg left to right they become: @Home, Booking Detail, Enquiry Detail

3 tabbed forms

Thanks

like image 526
Jaspos Avatar asked Dec 20 '25 03:12

Jaspos


1 Answers

Ok, I have inadvertently figured this out.

In testing I found that if you hide a tabbed form, when you unhide it, it doesn't show up in the same position, but in fact now shows as the last form (ie the rightmost tab)

Eureka! Now to reorder the forms I simply hide them, and then unhide them in the order required. Combine this with DoCmd.Echo = False and there is, in my testing, virtually zero overhead.

Phew!

like image 141
Jaspos Avatar answered Dec 22 '25 21:12

Jaspos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!