G
Guest
Hi, I'm new to access and am hoping someone can help me out. I'm trying to
use an option group to set a value of a field in a table. The option group
has 3 options. "yes" "no" and "na". This seemed a better option than
individual check boxes and fields.
I have the group unbound on a form and want to have the result of the option
group set the table value to "yes" or the other repsonses. I have so far
managed using a floating text box on the form i.e..
IF me.optiongp = 1 then
me.txtbox = "yes" Elseif
me.optiongp = 2 then
me.txtbox = "no" else
me.txtbox = "na"
endif
I'm not sure on how to link directly to the field in the table, so thought
perhaps I could run an sql update using the txtbox to update the table field
(say tbltest.Response). If this is a messy way round it i'd love to hear a
quicker solution.
Finally the bit that is really puzzling me is I would like the unbound
option group to display the value for the associated table field
(tbltest.Response) when the form is opened. I thought this would be a reverse
of the above if statement but it doesn't work.
i.e
me.txtbox.rowsource = "select response from tbltest"
IF me.txtbox = "yes" then
me.optiongroup.value = 1 etc
The option group remains unchecked. Is there a simple way to have my option
group display what lies in the table and also allow for dynamic updating on
clicking? Each record has a ID as identifier so this would need including in
the above code, as you can see i'm unsure about it all!
Many thanks in advance for any help.
R
use an option group to set a value of a field in a table. The option group
has 3 options. "yes" "no" and "na". This seemed a better option than
individual check boxes and fields.
I have the group unbound on a form and want to have the result of the option
group set the table value to "yes" or the other repsonses. I have so far
managed using a floating text box on the form i.e..
IF me.optiongp = 1 then
me.txtbox = "yes" Elseif
me.optiongp = 2 then
me.txtbox = "no" else
me.txtbox = "na"
endif
I'm not sure on how to link directly to the field in the table, so thought
perhaps I could run an sql update using the txtbox to update the table field
(say tbltest.Response). If this is a messy way round it i'd love to hear a
quicker solution.
Finally the bit that is really puzzling me is I would like the unbound
option group to display the value for the associated table field
(tbltest.Response) when the form is opened. I thought this would be a reverse
of the above if statement but it doesn't work.
i.e
me.txtbox.rowsource = "select response from tbltest"
IF me.txtbox = "yes" then
me.optiongroup.value = 1 etc
The option group remains unchecked. Is there a simple way to have my option
group display what lies in the table and also allow for dynamic updating on
clicking? Each record has a ID as identifier so this would need including in
the above code, as you can see i'm unsure about it all!
Many thanks in advance for any help.
R