check tab blank page before proceeding to next page

  • Thread starter forcefield via AccessMonster.com
  • Start date
F

forcefield via AccessMonster.com

Hi everyone,
My survey main form has a tab control and there are 4 pages or tabs. On each
page is one subform containing 4 option groups. Every option group has 5
checkboxes. These 5 checkboxes indicates “strongly agreeâ€,:agreeâ€,â€neutralâ€,
“agree†and “strongly agreeâ€

User must check one checkbox in each option group. Since there are 4 option
groups (or questions), all 4 option groups must be checked before he can
proceed to the next page.

Can someone please help me to code to ensure that the user checked all the
option groups before he can proceed to the next page? What event should I
place those codes?

Thank you
 
G

Guest

I am guessing that you change subform with a click event on the tabs. In
that case, change the on click event of the tabs from changing the subform to
an if statement.

If ((check1 OR check2 OR check3 OR check 4 OR check 5) AND ( check6 OR check
7 . . . ) Then
(Whatever it did before, change subform basically)
Else
MsgBox("You must answer all the questions on this page before you may
move to the next!")
End If

Also, you might want to reconsider options 4 and 5, they seem strangely
similar to 1 and 2! You know, unless you work for the government and are
conducting a government approval poll you might want to allow people to
disagree with your statements :).
 
F

forcefield via AccessMonster.com

Tks. will give it a try.
I am guessing that you change subform with a click event on the tabs. In
that case, change the on click event of the tabs from changing the subform to
an if statement.

If ((check1 OR check2 OR check3 OR check 4 OR check 5) AND ( check6 OR check
7 . . . ) Then
(Whatever it did before, change subform basically)
Else
MsgBox("You must answer all the questions on this page before you may
move to the next!")
End If

Also, you might want to reconsider options 4 and 5, they seem strangely
similar to 1 and 2! You know, unless you work for the government and are
conducting a government approval poll you might want to allow people to
disagree with your statements :).
Hi everyone,
My survey main form has a tab control and there are 4 pages or tabs. On each
[quoted text clipped - 11 lines]
Thank you
 
D

Dale Fye

This way would be a little more complicated, and would look more like a
Wizard form, but is another way you might consider.

First, set the TabStyle property to "None". This will actually hide the
tabs so the user cannot see them.

Then, add command buttons for Back and Next below the tab control on your
form. Initially, you would disable each of these controls. When the user
has selected an answer from each of the option groups on a particular tab
(you would need to evaluate something like MD indicated after the change
event of each option group), then you would enable the Back and Next
buttons. (Obviously you would not enable the Back button if you were on the
first tab or the Next button if you were on the last tab).

When they click one of these buttons, then you change the focus to the
appropriate tab, and disable the Back and Next buttons, until all the tabs
are complete, then, you would enable the "Submit" button.

HTH
Dale
 
F

forcefield via AccessMonster.com

I went through my problem and I find it quite daunting to check every option
group being left blank. Thank for such a great idea, Dale. Any idea is most
welcome.

Tks

Dale said:
This way would be a little more complicated, and would look more like a
Wizard form, but is another way you might consider.

First, set the TabStyle property to "None". This will actually hide the
tabs so the user cannot see them.

Then, add command buttons for Back and Next below the tab control on your
form. Initially, you would disable each of these controls. When the user
has selected an answer from each of the option groups on a particular tab
(you would need to evaluate something like MD indicated after the change
event of each option group), then you would enable the Back and Next
buttons. (Obviously you would not enable the Back button if you were on the
first tab or the Next button if you were on the last tab).

When they click one of these buttons, then you change the focus to the
appropriate tab, and disable the Back and Next buttons, until all the tabs
are complete, then, you would enable the "Submit" button.

HTH
Dale
I am guessing that you change subform with a click event on the tabs. In
that case, change the on click event of the tabs from changing the subform
[quoted text clipped - 33 lines]
 
D

Dale Fye

It's not really all that daunting. Create a simple subroutine for each of
the tabs. Then, in each option groups AfterUpdate event, run the
subroutine.

Private sub og_Tab1_og1_AfterUpdate

Call Buttons

End

Private Sub Buttons(TabIndex as integer)

Dim bAllChecked as boolean

if TabIndex = 0 then
bAllChecked = me.og1 IS NOT NULL AND me.og2 IS NOT NULL AND me.og3
IS NOT NULL and me.og4 is not NULL
elseif TabIndex = 1 then
bAllChecked = me.og5 IS NOT NULL AND me.og6 IS NOT NULL AND me.og7
IS NOT NULL and me.og8 is not NULL
elseif TabIndex = 2 then
......
elseif TabIndex = 3 then
......
endif

me.cmd_Back.Enabled = bAllChecked AND me.tabControlName > 0
me.cmd_Next.Enabled = bAllChecked AND TabIndex <
(me.TabControlName.Pages.Count-1)

End Sub

Private Sub cmd_Back_Click

me.TabControlName = me.TabControlName - 1

End Sub

Private Sub cmd_Next_Click

me.tabControlName = me.tabControlName + 1
Call Buttons(me.tabControlName)

End Sub

forcefield via AccessMonster.com said:
I went through my problem and I find it quite daunting to check every
option
group being left blank. Thank for such a great idea, Dale. Any idea is
most
welcome.

Tks

Dale said:
This way would be a little more complicated, and would look more like a
Wizard form, but is another way you might consider.

First, set the TabStyle property to "None". This will actually hide the
tabs so the user cannot see them.

Then, add command buttons for Back and Next below the tab control on your
form. Initially, you would disable each of these controls. When the user
has selected an answer from each of the option groups on a particular tab
(you would need to evaluate something like MD indicated after the change
event of each option group), then you would enable the Back and Next
buttons. (Obviously you would not enable the Back button if you were on
the
first tab or the Next button if you were on the last tab).

When they click one of these buttons, then you change the focus to the
appropriate tab, and disable the Back and Next buttons, until all the tabs
are complete, then, you would enable the "Submit" button.

HTH
Dale
I am guessing that you change subform with a click event on the tabs. In
that case, change the on click event of the tabs from changing the
subform
[quoted text clipped - 33 lines]
Thank you
 
F

forcefield via AccessMonster.com

Thanks Dale. I really do need those examples.


Dale said:
It's not really all that daunting. Create a simple subroutine for each of
the tabs. Then, in each option groups AfterUpdate event, run the
subroutine.

Private sub og_Tab1_og1_AfterUpdate

Call Buttons

End

Private Sub Buttons(TabIndex as integer)

Dim bAllChecked as boolean

if TabIndex = 0 then
bAllChecked = me.og1 IS NOT NULL AND me.og2 IS NOT NULL AND me.og3
IS NOT NULL and me.og4 is not NULL
elseif TabIndex = 1 then
bAllChecked = me.og5 IS NOT NULL AND me.og6 IS NOT NULL AND me.og7
IS NOT NULL and me.og8 is not NULL
elseif TabIndex = 2 then
......
elseif TabIndex = 3 then
......
endif

me.cmd_Back.Enabled = bAllChecked AND me.tabControlName > 0
me.cmd_Next.Enabled = bAllChecked AND TabIndex <
(me.TabControlName.Pages.Count-1)

End Sub

Private Sub cmd_Back_Click

me.TabControlName = me.TabControlName - 1

End Sub

Private Sub cmd_Next_Click

me.tabControlName = me.tabControlName + 1
Call Buttons(me.tabControlName)

End Sub
I went through my problem and I find it quite daunting to check every
option
[quoted text clipped - 32 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top