Dim CNT As Integer
Dim fd As Integer
Private Property CM As Object
Private Sub frmLogin_Load (ByVal sender As System. Object,
ByVal e the As System. EventArgs) Handles MyBase. Load
Me. UserTableAdapter. The Fill (Me) CourtMDataSet) UserInformation)
Cbotype. SelectedIndex=0
If the username="" Then
CNT=0
Txtuser. Text="csu"
TXTPWD. Text="csu"
End the If
End Sub
Private Sub Button1_Click (ByVal sender As System. Object,
ByVal e the As System. EventArgs) Handles for. Click
CNT=CNT + 1
If CNT=3 Then
End
End the If
If the Trim (txtuser. Text)="" Then
MsgBox (" please enter the user name ", vbOKOnly + vbExclamation, "")
The Exit Sub
End the If
fd=UserBindingSourse. Find (" username ", the Trim (txtuser. Text))
If fd=1 Then
MsgBox (" without the users "vbOKOnly + vbExclamation," ")
The Exit Sub
End the If
UserBindingSourse. Position=fd
If the Trim (UserBindingSourse. Current (2). The ToString) & lt;> Trim (Cbotype. Text) Then
MsgBox (" no eligible users, "vbOKOnly + vbExclamation," ")
The Exit Sub
End the If
If the Trim (UserBindingSourse. Current (1). The ToString)=Trim (TXTPWD. Text) Then
UserID=txtuser. Text
If the Trim (Cbotype. Text)="administrator" Then
Usertype=1
The Else
Usertype=2
End the If
Me. The Dispose ()
CM. VbMain. The Show ()
The Else
MsgBox (" password incorrect ", vbOKOnly + vbExclamation, "")
The Exit Sub
End the If
End Sub
Private Sub Button2_Click (ByVal sender As System. Object,
ByVal e the As System. EventArgs) Handles Button2. Click
Me. The Dispose ()
End Sub
Private Sub Cbotype_SelectedIndexChanged (ByVal sender As System. Object, ByVal e the As System. EventArgs)
End Sub
Private Sub Cbotype_SelectedIndexChanged_1 (ByVal sender As System. Object, ByVal e the As System. EventArgs)
End Sub
Private Sub txtuser_TextChanged (ByVal sender As System. Object, ByVal e the As System. EventArgs)
End Sub
Private Sub ComboBox1_SelectedIndexChanged (ByVal sender As System. Object, ByVal e the As System. EventArgs) Handles Cbotype. SelectedIndexChanged
End Sub
Private Function UserBindingSourse () As the Object
Me. Hide ()
CMFrmMain. The Show ()
End the Function
The End of the Class
Red said that error is not set or something
Curriculum design, this is our university, but because have not learned so completely copy the code from the book
O solve ah,,
CodePudding user response:
Fd=UserBindingSourse. Find (" username ", the Trim (txtuser. Text))This sentence
CodePudding user response:
This thing should be UserBindingSourse need no references or statementCodePudding user response:
I see your code here, UserBindingSourse is a "function" :Private Function UserBindingSourse () As Object
However, within the function body "is not the assignment, then its value should be" default ": Nothing
This function returns, then call object method/function, is bound to have this kind of hint,
Your "previous posts", according to you is said to be "normal" can run, you don't Copy the code to complete this time!
You should refer to the previous code, carries on the corresponding revision,
CodePudding user response:
Private type UserBindingSourseFind the as...
End type
CodePudding user response:
You need to reference this, do you want to see the manual, this is it contains from which,CodePudding user response:
UserBindingSourse is a "function" :Private Function UserBindingSourse () As the Object
However, within the function body "is not the assignment, then its value should be" default ": Nothing
This function returns, then call object method/function, is bound to have this kind of hint,