VB中“用户定义类型未定义”问题
PublicOriIdAsLong'报废单编号PrivateSubCmd_Cancel_Click()UnloadMeEndSubPrivateSubCmd_Submit...
Public OriId As Long '报废单编号
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Submit_Click()
Dim sToName As String '收件人
Dim sTo As String '收件人邮件地址
Dim sFrom As String '发件人邮件地址
Dim sSubject As String '邮件主题
Dim sText As String '邮件内容
'提交审批通知,发送邮件给审批经理
sFrom = Trim(CurUser.Email) '取得当前用户的电子邮箱地址
sToName = Trim(dco_UserName.BoundText) '取得审批人用户名
If MyUser.GetInfo(sToName) = True Then
sTo = Trim(MyUser.Email) '得到审批人邮件地址
sText = "请审批设备管理系统中的报废申请"
sSubject = "请审批报废申请"
Dim objMail As CDONTS.NewMail(这个地方在VB中显示报错)
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = sFrom
objMail.To = sTo
objMail.Subject = sSubject
objMail.Body = sText
objMail.Send
Set objMail = Nothing
'更改报废申请状态和审批人
MyDiscard.Checker = sUserName
MyDiscard.Status = "提交"
MyDiscard.UpdateStatus OriId, 1
MsgBox ("已经将审批通知发送给审批人:" + sUserName)
Else
MsgBox ("没有审批经理的电子邮箱地址,请找管理员添加")
Exit Sub
End If
Unload Me
End Sub
Private Sub Form_Load()
DataRefresh
End Sub
Private Sub DataRefresh()
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = "SELECT * FROM Users WHERE UserType=2"
Adodc1.Refresh
Set dco_UserName.RowSource = Adodc1
dco_UserName.ListField = "UserName"
dco_UserName.BoundColumn = "UserName"
End Sub
在生成.exe可执行文件时出现“用户定义类型未定义”错误。请各位帮忙小弟看一下。谢谢 展开
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Submit_Click()
Dim sToName As String '收件人
Dim sTo As String '收件人邮件地址
Dim sFrom As String '发件人邮件地址
Dim sSubject As String '邮件主题
Dim sText As String '邮件内容
'提交审批通知,发送邮件给审批经理
sFrom = Trim(CurUser.Email) '取得当前用户的电子邮箱地址
sToName = Trim(dco_UserName.BoundText) '取得审批人用户名
If MyUser.GetInfo(sToName) = True Then
sTo = Trim(MyUser.Email) '得到审批人邮件地址
sText = "请审批设备管理系统中的报废申请"
sSubject = "请审批报废申请"
Dim objMail As CDONTS.NewMail(这个地方在VB中显示报错)
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = sFrom
objMail.To = sTo
objMail.Subject = sSubject
objMail.Body = sText
objMail.Send
Set objMail = Nothing
'更改报废申请状态和审批人
MyDiscard.Checker = sUserName
MyDiscard.Status = "提交"
MyDiscard.UpdateStatus OriId, 1
MsgBox ("已经将审批通知发送给审批人:" + sUserName)
Else
MsgBox ("没有审批经理的电子邮箱地址,请找管理员添加")
Exit Sub
End If
Unload Me
End Sub
Private Sub Form_Load()
DataRefresh
End Sub
Private Sub DataRefresh()
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = "SELECT * FROM Users WHERE UserType=2"
Adodc1.Refresh
Set dco_UserName.RowSource = Adodc1
dco_UserName.ListField = "UserName"
dco_UserName.BoundColumn = "UserName"
End Sub
在生成.exe可执行文件时出现“用户定义类型未定义”错误。请各位帮忙小弟看一下。谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询