preview

Questions On Private Sub Form

Better Essays

Form-2 Private Sub Command1_Click(Index As Integer) Unload Me Form7.Show Form7.newad.Enabled = False Form7.adcurr.Enabled = False Form7.modify.Enabled = False Form7.delete.Enabled = False End Sub Private Sub Command2_Click(Index As Integer) Unload Me Form3.Show End Sub Private Sub Command3_Click() Unload Me End Sub Private Sub Form_Load() Form2.WindowState = 2 Form2.Caption = " STATUS PAGE" End Sub Form-3 Public cn As New ADODB.Connection Public rs As New ADODB.Recordset Public rs1 As ADODB.Recordset Private Sub Command1_Click() If cn.State = 0 Then cn.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Persist Security Info=True" End If Dim find As String If Text1.Text Like "2k2mc###" Then find = " select * from log where ad_user = '" & Text1.Text & " ' " rs.Open find, cn, adOpenDynamic, adLockOptimistic If rs.EOF And rs.BOF Then MsgBox " Error!!!You are not VALID USER!!!", vbInformation + vbOKOnly, "Student Information System" Text1.Text = "" Text2.Text = "" Text1.SetFocus rs.Close Exit Sub End If If rs.Fields("Ad_user") = Text1.Text And rs.Fields("ad_passwd") = Text2.Text Then MsgBox "Welcome Administrator" rs.Close Unload Me Form7.Show Else MsgBox "You are not VALID USER!!!", vbInformation + vbOKOnly, "Student Information System" Text1.Text = "" Text2.Text = ""

Get Access