"Undo" an option group selection

M

martinmike2

Hello,

I have an option group that allows the user to select types of base
housing. If the record has been changed to an "Off Base" address,
then we need to remove the Base Housing selection. I can't use the
OldValue property because the record has already been saved.

If I try to manipulate the record itself:

dim db as dao.database, rst as dao.recordset

set db = currentdb
set rst = me.recordset
rst.edit
rst!BASE_HOUSE_TYPE = 0
rst.update
rst.close
set rst = nothing
set db = nothing

I get it removing the selection, but every control on the form shows
#name? untill i close out the form and reopen it. I tried adding a
me.refresh at the end of the code to no effect.
 
D

Dale Fye

Mike,

I don't get it. If you have an option group on your form, why don't you
just click the radio button that corresponds to "off base housing"?

Is your option group frame linked to the Base_House_Type? If so, you should
just be able to set the value of that control to zero, then save the record
again.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
M

martinmike2

Dale,

Thank you, you kicked my brain back into gear for me.

I used "me.frmhousing.value = 0" in the click event of the button.
thanks again.
 
D

Dale Fye

Mike,

This makes it sound to me like the option group is not bound. I would make
the option group bound to your frmHousing field, then you don't need any code
behind the radio button to change the value.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 

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