Please help me on my project. I used this for my log in form. The registration form worked well and its easy for me. There are many errors almost 3. The errors are on the first 3 statements.
line 1: syntax error (missing operator) in query expression 'ID Number = '[what i type]''.
line 2: method 'refresh' of object 'iadodc' failed
line 3: object variable or with block variable not set
Private Sub Command1_Click()
Adodc1.RecordSource = ("select * from Student where ID Number ='" & Text1.Text & "'") '<=== line 1
Adodc1.Refresh '<=== line 2
If (Adodc1.Recordset.EOF = False) Then '<=== line 3
If Adodc1.Recordset.Fields("Password") = Text2.Text Then
MsgBox ("Successfully Logged-in"), vbInformation, "Log-in"
Homepage.Label1.Caption = Text1.Text
Homepage.Label2.Visible = True
Login.Visible = False
Homepage.Visible = True
Else
Val (X) + 1
MsgBox ("Wrong Log-in information"), vbInformation + vbRetryCancel, "Log-in"
End If
Else
Val (X) + 1
MsgBox ("Wrong Log-in information"), vbInformation + vbRetryCancel, "Log-in"
End If
If X = 3 Then
MsgBox ("Maximum Log-in Reached!"), vbCritical + vbOKOnly, "Log-in"
End If
End Sub
Private Sub Command2_Click()
answer = MsgBox("Do you want to cancel?", vbExclamation + vbYesNo, "Confirm")
If answer = vbYes Then
End
Else
MsgBox "Action canceled", vbInformation, "Confirm"
End If
End Sub
Private Sub Form_Load()
Dim X As Integer
X = 0
End Sub