Foxtable(狐表)用户栏目专家坐堂 → [求助代码错误


  共有2196人关注过本帖平板打印复制链接

主题:[求助代码错误

帅哥哟,离线,有人找我吗?
hanzhang98
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:493 积分:3637 威望:0 精华:0 注册:2018/6/8 21:14:00
[求助代码错误  发帖心情 Post By:2019/3/28 9:41:00 [只看该作者]

各位老师好!窗体中有三个控件“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编辑过]

 回到顶部