help! database check
here is my code.. if the user entered his account code his name will appear on the window and if he click the button it will continue to the next page... my 2nd question, where will i put the code that i askeD? tnx guys!
Private Sub cmdCancel_Click()
Unload Me
frmMenu.Enabled = True
frmMenu.Show
End Sub
Private Sub cmdGo_Click()
Dim moo As String
If txtclassno.Text = "" Then
moo = MsgBox("Please fill out the fields!", vbExclamation)
Exit Sub
End If
Call lname
txtclassno.Text = ""
frmAddRecord.lblstudname.Caption = ""
End Sub
Private Sub lname()
tclassno = txtclassno.Text
opn_sql
sqlcmd = "Select * from studlist where (CLASSNO = '" & tclassno & "');"
Set rst = cnn.Execute(sqlcmd)
If Not rst.EOF Then
frmStudentRecord.Show
frmStudentRecord.lblStno.Caption = rst("STUDNO")
frmStudentRecord.lblClno.Caption = rst("CLASSNO")
frmStudentRecord.lblFName.Caption = rst("NAMEFIRST")
frmStudentRecord.lblLName.Caption = rst("NAMELAST")
Else
moo = MsgBox("No Record Found!", , "Search Error")
txtclassno.Text = ""
End If
cls_sql
End Sub
Private Sub Form_Load()
frmMenu.Enabled = False
End Sub
Private Sub txtclassno_Change()
If Len(txtclassno.Text) = 4 Then
Clno = txtclassno.Text
opn_sql
sqlcmd = "Select * from studlist where CLASSNO = '" & Clno & "';"
Set rst = cnn.Execute(sqlcmd)
If Not rst.EOF Then
frmAddRecord.lblstudname.Caption = rst("namelast") + ", " + rst("namefirst")
Else
moo = MsgBox("No Record Found!", , "Search Error")
txtclassno.Text = ""
End If
cls_sql
End If
End Sub

