skip patterns w/conditions in a form based on a questionnaire

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am designing forms (all of which are based from the same table) based from
a questionnaire and am trying to implement skip patterns for certain fields
that are set up as option groups (1=Yes; 2=No). What I want to do is when
those particular fields equal 'No', I want the focus to switch to the first
field in the next form. Can someone tell me what I need to write for VBA code
to accomplish this? In addition, do I write the code from the 'No' checkbox
w/in the option group creating an event procedure using the 'On Got Focus'
property or from the overall control (option group) creating an event
procedure using the 'Click' property--and I think both methods then would
need the SetFocus method? Thanks.
 
I would write the code in the frame's On Click event, then based on the value
of the selection change the focus. This way if you need to run code based on
the other options you may put the code in the same event.

This only works if both forms are open.

Private Sub Frame9_Click()
If Frame9.Value = 1 Then
Form_Form3.SetFocus
Form_Form3.Text0.SetFocus
End If
End Sub

Hope this helps.
Good Luck!
 
Thank you very much, this helped immensely!


visdev1 said:
I would write the code in the frame's On Click event, then based on the value
of the selection change the focus. This way if you need to run code based on
the other options you may put the code in the same event.

This only works if both forms are open.

Private Sub Frame9_Click()
If Frame9.Value = 1 Then
Form_Form3.SetFocus
Form_Form3.Text0.SetFocus
End If
End Sub

Hope this helps.
Good Luck!
 
Hello Rob,

Having one table will be ok--once all the data is collected, it will then be
exported as a dbase IV file then imported into SAS for data analysis. It's
worked before. Are you referring to the data being analyzed using Access?
Thanks for your help.
 
Yes. I was referring to attempting to analyse the data in Access when the
table is structured in the same way as a spreadsheet. That is a grotesque
and horribly inflexible way of doing it. But as long as you know how you're
actually going to do the analysis then you should be OK.
 
Back
Top