>I think I have find the answer, I try to take out the customer.choice from the optiongroup1's controlsource property, and the problem solve.
>
>I don't know why we should leave the controlsource's property empty. But it works. Can explain why?
It should contain an integer, and your controlsource was character. The .value of an optiongroup is always an integer, which denotes the position of the button clicked, i.e. if you click optiongroup1.commandbutton2, then optiongroup1.value=2, for the second button.
All in all, I think you should have used a listbox or combo instead.
>I have replace the following codes in the click event.
>replace customer.choice with this.buttons(this.value).caption
>
>No more problems now.
Of course, but it won't work the other way 'round - when you display a record with some value, the corresponding button won't select automatically. You'd have to code around it in the optiongroup's refresh method, like this:
for i=1 to this.buttoncount
if customer.choice=this.buttons[i].caption
this.value=i
exit
endif
endfor
This is the reverse of what you do when you click on an individual button; when you click, you picked an integer (1,2,3... the ordinal number of the button), and assigned the customer.choice the caption of the button. This time we scan through the captions to find the one, and then pick its number.