各位老师好!窗体中有三个控件“RadioButton(单选框)”,分别是:RadioButton1、RadioButton2、RadioButton3,分别对应字符“到龄退休”、“个人辞职”、“公司辞退”。想做到分别点选控件时能将其对应的字符串赋值给变量"Ly1”。但代码运行出错,请老师指正。谢谢。
Dim Ly1 As String
'If e.Form.Controls("RadioButton1").Sender = True Then
'Ly1 = "到龄退休"
'msgbox(Ly1)
'End If
Select Case e.Form.Controls("RadioButton")
Case e.Form.Controls("RadioButton1")
Ly1 = "到龄退休"
msgbox(Ly1)
Case e.Form.Controls("RadioButton2")
Ly1 = "个人辞职"
msgbox(Ly1)
Case e.Form.Controls("RadioButton1")
Ly1 = "公司辞退"
msgbox(Ly1)
End Select
[此贴子已经被作者于2019/3/28 9:43:18编辑过]