Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resetting the value of an Option Group Control

Status
Not open for further replies.

Cads

Technical User
Jan 17, 2000
40
GB
Hopefully this is one of those problems with a quick solution!

I've got an option group box on a form with 2 option buttons inside it. This collection of objects works fine with various screen changes occuring quite correctly when each option button is chosen.

I now want to refine the arrangement by trapping a subsequent button click (after data has been entered in fields after the first button choice has been made) warning the user of the consequences of the new choice and offering them a chance to rescind their decision. (ie 'If you now choose button 2 this will delete all data in fields...) I decided to do this in the BeforeUpdate event proc with a 'Cancel=true' statement if they decided on a rescind.

So far, so good.

What I can't get to occur, however, is for the button selection to revert back to it's original value. Tried things like:

Me.frame28.value = Me.frame28.oldvalue

but just get a runtime error message (2115) along the lines " the above line is preventing MS Access from saving data in this field".

Any ideas how to (elegantly) revert the button position back to what it was after the 'Cancel=True' line is processed.....please?

Steve House
shouse@icaew.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top