gotocontrol action subject to option group value

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

Guest

a certain section of my a2k form has an option group with seven buttons with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either 1st or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1 which is
ok when button #1 gets the vote but not as cool in the 6 remaining instances.
now, i know that this is just the frosting on the cake, but it'd be cool to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the cursor
jumps to the depressed option group button. which is just fine!! when a user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly selected's.

[in case that's not enough detail....the values of the option group's speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub
 
hi mike, not being the vba whiz you are....

in words, what is this code intent upon doing?

thanks,

ted

Mike said:
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub



Ted said:
a certain section of my a2k form has an option group with seven buttons with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either 1st or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1 which is
ok when button #1 gets the vote but not as cool in the 6 remaining instances.
now, i know that this is just the frosting on the cake, but it'd be cool to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the cursor
jumps to the depressed option group button. which is just fine!! when a user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly selected's.

[in case that's not enough detail....the values of the option group's speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
Seems like a lot of work to me. Why not just set the focus on the control
you want it on.

Sub Frame1_AfterUpdate()

Select Case Frame1.Value
Case 1
me.text1.setfocus
Case 2
me.text2.setfocus
Case ...
'you get the idea
Case y
'or you could use the docmd.gotocontrol method
docmd.gotocontrol "Text7"
End select

end sub

--
HTH

Dale


Mike said:
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub



Ted said:
a certain section of my a2k form has an option group with seven buttons with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either
1st
or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1
which
is
ok when button #1 gets the vote but not as cool in the 6 remaining instances.
now, i know that this is just the frosting on the cake, but it'd be cool to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the cursor
jumps to the depressed option group button. which is just fine!! when a user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly selected's.

[in case that's not enough detail....the values of the option group's speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
seems like a workable approach -- will give it a go and get back w/ more
questions as warranted.

thx dale.

ted

Dale Fye said:
Seems like a lot of work to me. Why not just set the focus on the control
you want it on.

Sub Frame1_AfterUpdate()

Select Case Frame1.Value
Case 1
me.text1.setfocus
Case 2
me.text2.setfocus
Case ...
'you get the idea
Case y
'or you could use the docmd.gotocontrol method
docmd.gotocontrol "Text7"
End select

end sub

--
HTH

Dale


Mike said:
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub



Ted said:
a certain section of my a2k form has an option group with seven buttons with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either
1st
or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1
which
is
ok when button #1 gets the vote but not as cool in the 6 remaining instances.
now, i know that this is just the frosting on the cake, but it'd be cool to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the cursor
jumps to the depressed option group button. which is just fine!! when a user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly selected's.

[in case that's not enough detail....the values of the option group's speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
dale,

this is my code:

Private Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1
Me.Date_on_List.Value.SetFocus
Case 2
Me.RegisteredDate.SetFocus
Case 3
Me.TXBegunDate.Value.SetFocus
Case 4
Me.TXEndedDate.SetFocus
Case 5
Me.OffStudyDate.SetFocus
Case 6
Me.LTFUDate.SetFocus
Case 7
Me.DateDth.SetFocus
Case Else
End Select
End Sub

i found that for two of my fields, there was no option to use the 'SetFocus'
thing, so i added the ".value" thing (newbie here) and then the debugger
quiteted down until i actually went and opened the form at which time it
highlighted the first one in yellow and says that an object is required. if i
omit the 'value' from the two fields, then it won't compile and complains of
a member not being found if i recollect.

ted

Dale Fye said:
Seems like a lot of work to me. Why not just set the focus on the control
you want it on.

Sub Frame1_AfterUpdate()

Select Case Frame1.Value
Case 1
me.text1.setfocus
Case 2
me.text2.setfocus
Case ...
'you get the idea
Case y
'or you could use the docmd.gotocontrol method
docmd.gotocontrol "Text7"
End select

end sub

--
HTH

Dale


Mike said:
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub



Ted said:
a certain section of my a2k form has an option group with seven buttons with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either
1st
or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1
which
is
ok when button #1 gets the vote but not as cool in the 6 remaining instances.
now, i know that this is just the frosting on the cake, but it'd be cool to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the cursor
jumps to the depressed option group button. which is just fine!! when a user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly selected's.

[in case that's not enough detail....the values of the option group's speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
sorry, i forgot to add this....

what would you do to get the 'toggle button' to change its color on being
clicked?

tia,

ted

Ted said:
dale,

this is my code:

Private Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1
Me.Date_on_List.Value.SetFocus
Case 2
Me.RegisteredDate.SetFocus
Case 3
Me.TXBegunDate.Value.SetFocus
Case 4
Me.TXEndedDate.SetFocus
Case 5
Me.OffStudyDate.SetFocus
Case 6
Me.LTFUDate.SetFocus
Case 7
Me.DateDth.SetFocus
Case Else
End Select
End Sub

i found that for two of my fields, there was no option to use the 'SetFocus'
thing, so i added the ".value" thing (newbie here) and then the debugger
quiteted down until i actually went and opened the form at which time it
highlighted the first one in yellow and says that an object is required. if i
omit the 'value' from the two fields, then it won't compile and complains of
a member not being found if i recollect.

ted

Dale Fye said:
Seems like a lot of work to me. Why not just set the focus on the control
you want it on.

Sub Frame1_AfterUpdate()

Select Case Frame1.Value
Case 1
me.text1.setfocus
Case 2
me.text2.setfocus
Case ...
'you get the idea
Case y
'or you could use the docmd.gotocontrol method
docmd.gotocontrol "Text7"
End select

end sub

--
HTH

Dale


Mike said:
You'll want to change the TabIndex property of the controls depending on
what option is selected from the Option Group.
I'd create a function to call that will set the TabIndex of the controls,
depending on the option selected.

Sub Frame1_AfterUpdate()
Select Case Frame1.Value
Case 1, 5
Me!Option1.TabIndex = 0
Me!TextBox1.TabIndex = 1
etc...
Case Else

End Select
End Sub



a certain section of my a2k form has an option group with seven buttons
with
data (Outcome_) values 1,...,7.

the first (1) and fifth (5) buttons each has two text controls adjoining
them which the user would need to complete given (s)he chooses either 1st
or
5th.

buttons 2,3,4,6 and 7 each has only one text box.

i have thus far used autoorder to dictate the cursor's movement and in
testing the application find that when the user presses a button and hits
'tab' that the cursor jumps to the text control adjoining button #1 which
is
ok when button #1 gets the vote but not as cool in the 6 remaining
instances.
now, i know that this is just the frosting on the cake, but it'd be cool
to
have my cursor given the sense of where to go.

i've observed the fact that as i scroll through the records with this
form,
that if i place my cursor on the (text) field/control which occurs just
before the borders of the option group and hit the 'tab' key that the
cursor
jumps to the depressed option group button. which is just fine!! when a
user
typically comes to this part of the form, (s)he will likely as not be
pressing a button with a higher value than the one which was initially
available and wanting to fill in the control adjoining the newly
selected's.

[in case that's not enough detail....the values of the option group's
speak
to the history of folks who are being screened for entry into, and then
followed over time as they progress through the rigors, of human clinical
trials. the controls adjoining each button acquire the date that the
status
(screened, registered, treatment begun, treatment ended, patient went off
study, patient died) occurred and in the instance of the screened and off
study, a combobox is completed with relevant addenda]

i know this is going to take a bit of vba, but as to which approach, well
that's y i'm writing.

anyone?
 
Back
Top