0
votes

I've got a form with 8 pages and I'd like to ensure that all the pages are clicked (ie. filled out) before the user can close the form.

And I've got a subform on one of the pages that is a tab control with 2 pages. What I want to do is make sure that the user has filled out (clicked on) both pages before the main form can close.

I don't really know the best way to go about this.

What I've got so far is:

Private Sub tabcontrol_Change()
    If (tabcontrol.value = 1) Then
        page2clicked = True
    End If
End Sub

And this records if the second page of the subform was clicked or not. But I don't know what to do with this to prevent the main form from closing.

I could also use this for the 8 pages on the main form but I don't know if this is sufficient or not.

Maybe.... hide the close button?

I'm open to any ideas of the best way to go about this problem.

Thanks!

EDIT: If this is not easy (I'm guessing its not) then is there a way to make the 2 tabs on the subform tab control more visible for the user to see?

1
Why are you sure that if they clicked it got filled up? I'd loop controls to ensure all required controls aren't empty before closing form (click event in close button) - Horaciux
Good Idea. But all my controls have a default value and users can just leave them as the default if "no" is the correct answer. So if I loop through all of the controls will have a value even if the user didn't go to that page. - VT555
You could hide close button and add navigation buttos (prev next) and show close button in last page - Horaciux
How would I show the close button only on the last page? - VT555
me.CloseButton=False on load event. When user reaches last page me.CloseButton=true. - Horaciux

1 Answers

1
votes

Hide close buton in design view.

CloseButton=False 

Add a new button in last page. This new button should close the form in click event.