我從Excel 2016 VBA下面的代碼。對象如何與客戶斷開連接?
Private Sub useridno_AfterUpdate()
Dim strMsg As String
Dim ret_type As Integer
Dim strTitle As String
strTitle = "Wrong User ID Number!"
strMsg = " Would you like to try again?"
If Me.useridno.Value <> 1 Then
ret_type = MsgBox(strMsg, vbYesNo + vbCritical, strTitle)
Select Case ret_type
Case 6
Me.useridno.SetFocus
Me.useridno.Text = ""
Case 7
Unload Me
End Select
End If
End Sub
當我運行它,它返回以下錯誤:
發生這種情況時,我選擇在消息框中的「否」按鈕。這是爲什麼?
變化的數據類型與變種昏暗ret_type作爲整數變暗ret_type爲Variant – Sixthsense
什麼樣的控制是'useridno'? –
@RobinMackenzie,這是我的用戶表單中的文本框。 –