아래의 코드를 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
, 그것은 다음과 같은 오류를 반환 : 나는 메시지 상자에 "아니오"버튼을 선택하면
이 발생합니다. 이게 왜 그렇게?
데이터 유형을 변형으로 변경합니다. dim ret_type을 정수로 변경합니다. ret_type을 변형으로 – Sixthsense
어떤 종류의 제어가'useridno'입니까? –
@RobinMackenzie, 내 userform에있는 텍스트 상자입니다. –