how to create a form with sections

I’d like to add sections in a form and use buttons to switch from a section to an other.

Supposing to have a form called FORMULARIO and 4 sections called UNO, DUE, TRE and QUATTRO, how do i make it work?

Searching in the internet i found this macro and seems to be similar to what i need, but it was not provided of comments and so, i don’t know how to custumize it, nor i’m able in write a macro by myself.

Any help?

sub PysAfficher(PysEvent)

dim i as integer

for i = 0 to thiscomponent.TextSections.count - 1

if thiscomponent.TextSections(i).name = PysEvent.Source.Model.Name then

thiscomponent.TextSections(i).IsVisible = true

else

thiscomponent.TextSections(i).IsVisible = false

PysEvent.Source.Model.parent.getByName(thiscomponent.TextSections(i).name).state = 0

end if

next i

end sub

Thanks in advance to anybody will help me.

Hello,

It is necessary to have some understanding of macros to do this. The method for sections is fairly simple - isVisible = true shows the section and isVisible = false hides the section.

Please see this post → Tabbed forms within a Main Form. In the answer is a sample. The simple macros are run by push buttons.

It contains three sections - Main, Employee and Title. You should be able to add a fourth and rename what is there. Hopefully this will get you started.

There is also a link to another answer there which contains another different but more complex sample.

I must be missing something. When I open form MainStart in that database in design view, all I can see is a horizontal bar with two buttons on it. I can’t find the sections referenced in the macros.

@philhaney,

When editing the form, from menu select Format->Sections.

That’s got it. Thank you!