0% found this document useful (0 votes)
51 views

Enquiry

This document contains code for an enrollment form application. It includes sections for the home page, enrollment form, and search functionality. The home page code handles loading and unloading different forms. The enrollment form code validates the input, saves the data to a recordset, and handles dropdown selections. The search code filters the recordset based on selected criteria and populates a record control with the results.

Uploaded by

milangohil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Enquiry

This document contains code for an enrollment form application. It includes sections for the home page, enrollment form, and search functionality. The home page code handles loading and unloading different forms. The enrollment form code validates the input, saves the data to a recordset, and handles dropdown selections. The search code filters the recordset based on selected criteria and populates a record control with the results.

Uploaded by

milangohil
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

HOME PAGE

ENQUIRY SLIP
SEARCH PAGE
CODE:

HOME PAGE
Private Sub Command1_Click()
Unload Me
Form2.Hide
Load Form1
Form1.Show
End Sub

Private Sub Command2_Click()


Unload Me
Form2.Hide
Load search
search.Show
End Sub

Private Sub Command3_Click()


End
End Sub

ENQUIRY SLIP

Dim var As Integer

Private Sub Command1_Click()


Dim intmsg As Integer
If Text1.Text = "" Then
intmsg = MsgBox("Please Enter Ur Name", vbExclamation)
Else
If Text2.Text = "" Then
intmsg = MsgBox("Please Enter Ur Address", vbExclamation)
Else
If Text6.Text = "" Then
intmsg = MsgBox("Please Enter Ur Pincode", vbExclamation)
Else
If (Text3.Text = "") Or (Text4.Text = "") Then
If (Text3.Text = "") Then
Text3.Text = "0"
Else
Text4.Text = "0"
End If
Else
If Option2(0).Value = False And Option2(1).Value = False Then
intmsg = MsgBox("Please Select Ur Status", vbExclamation)
Else
If Combo1.Text = "Select One" Or Combo2.Text = "Select One" Or
Combo3.Text = "Select One" Then
intmsg = MsgBox("U Have Not Selected Course, Media or Timing",
vbExclamation)
Else
Adodc1.Recordset.Fields(2) = UCase(Text1.Text)
Adodc1.Recordset.Fields(3) = UCase(Text2.Text)
If Option1(0).Value = True Then
Adodc1.Recordset.Fields(10) = "d"
Else
Adodc1.Recordset.Fields(10) = "c"
End If
Adodc1.Recordset.Update
Unload Me
Form1.Hide
Load Form2
Form2.Show
End If
End If
End If
End If
End If
End If

End Sub

Private Sub Command2_Click()


Me.Hide
Form2.Show
End Sub

Private Sub Form_Load()


If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MoveFirst
While Adodc1.Recordset.EOF = False
If (Date - Adodc1.Recordset.Fields(1)) > 30 Then
If Adodc1.Recordset.Fields(11) = "l" Then
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
End If
End If
Adodc1.Recordset.MoveNext
Wend
End If
If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MoveLast
var = Int(Adodc1.Recordset.Fields(0) + 1)
Adodc1.Recordset.AddNew
Text5.Text = var
Else
Adodc1.Recordset.AddNew
Text5.Text = 1
End If
lblDate.Caption = Date
Combo1.Text = "Select One"
Combo2.Text = "Select One"
Combo3.Text = "Select One"
End Sub

Private Sub Option1_Click(Index As Integer)


Select Case Index
Case 0
Combo1.List(0) = "Web Engineering"
Combo1.List(1) = "Info.Tech.- I Year"
Combo1.List(2) = "Info.Tech.- II Year"
Combo1.List(3) = "E-Commerce"
Combo1.List(4) = "H/W and Networking"
Combo1.List(5) = "Comp. App. & Multilingual DTP"
Combo1.List(6) = "Computer Programming"
Combo1.Text = "Select One"
Case 1
Combo1.List(0) = "Fashion Designing"
Combo1.List(1) = "MSCIT"
Combo1.List(2) = "Financial Accounting"
Combo1.List(3) = "Computer Animation"
Combo1.List(4) = "Oracle"
Combo1.List(5) = "Visual Basic"
Combo1.List(6) = "DTP"
Combo1.List(7) = "Office Applications"
Combo1.List(8) = "MCSE Window2000"
Combo1.List(9) = "CCNA"
Combo1.List(10) = "Linux"
Combo1.List(11) = "Mobile Repairing"
Combo1.Text = "Select One"
End Select
End Sub

Private Sub Option2_Click(Index As Integer)


Select Case Index
Case 0
Adodc1.Recordset.Fields(11) = "l"
Case 1
Adodc1.Recordset.Fields(11) = "a"
End Select
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


Dim intmsg As Integer
If Not (((KeyAscii >= 65) And (KeyAscii <= 92)) Or ((KeyAscii >= 97) And
(KeyAscii <= 122)) Or (KeyAscii = 8) Or (KeyAscii = 32)) Then
intmsg = MsgBox("Please Enter Correct Name", vbInformation)
KeyAscii = 8
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)


Dim intmsg As Integer
If Not (((KeyAscii >= 48) And (KeyAscii <= 57)) Or (KeyAscii = 8)) Then
intmsg = MsgBox("Please Enter Correct Tel. No", vbInformation)
KeyAscii = 8
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)


Dim intmsg As Integer
If Not (((KeyAscii >= 48) And (KeyAscii <= 57)) Or (KeyAscii = 8)) Then
intmsg = MsgBox("Please Enter Correct Tel. No", vbInformation)
KeyAscii = 8
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
Dim intmsg As Integer
If Not (((KeyAscii >= 48) And (KeyAscii <= 57)) Or (KeyAscii = 8)) Then
intmsg = MsgBox("Please Enter Correct Pincode", vbInformation)
KeyAscii = 8
End If
End Sub

SEARCH PAGE
Private Sub Command1_Click()
inv = 0
Record.ClearStructure
Record.Rows = 2
Record.Row = 0
Record.Col = 0
Record.Text = "Form No."
Record.Col = Record.Col + 1
Record.Text = "Date"
Record.Col = Record.Col + 1
Record.Text = "Name"
Record.Col = Record.Col + 1
Record.Text = "Address"
Record.Col = Record.Col + 1
Record.Text = "Pincode"
Record.Col = Record.Col + 1
Record.Text = "Telephone"
Record.Col = Record.Col + 1
Record.Text = "Office"
Record.Col = Record.Col + 1
Record.Text = "Course"
Record.Col = Record.Col + 1
Record.Text = "Media"
Record.Col = Record.Col + 1
Record.Text = "Timing"
Record.Col = Record.Col + 1
Record.Text = "Type"
If Option1(0).Value = True Then
If Combo1.Text = "Select One" Then
MsgBox ("Please Select Course")
inv = 1
Else
If Option2(0).Value = False And Option2(1).Value = False Then
MsgBox ("Please Select Course Type")
inv = 1
Else
If Check1.Value = 0 And Check2.Value = 0 Then
MsgBox ("Please Select Status")
inv = 1
Else
If Option2(0).Value = True Then
opt2 = "d"
Else
opt2 = "c"
End If
If Check1.Value = 1 And Check2.Value = 1 Then
opt1 = "no"
Else
If Check1.Value = 1 Then
opt1 = "l"
Else
If Check2.Value = 1 Then
opt1 = "a"
End If
End If
End If
If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MoveFirst
Record.Row = 0
While Adodc1.Recordset.EOF = False
Record.Col = 0
If Combo1.Text = Adodc1.Recordset.Fields(7) Then
If opt1 <> "no" Then
If Adodc1.Recordset.Fields(11) = opt1 Then
opt1 = "no"
End If
End If
If opt1 = "no" Then
Record.Visible = True
Record.Row = Record.Row + 1
Record.Rows = Record.Rows + 1
Record.Text = Adodc1.Recordset.Fields(0)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(1)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(2)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(3)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(4)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(5)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(6)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(7)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(8)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(9)
Record.Col = Record.Col + 1
If Adodc1.Recordset.Fields(11) = "l" Then
Record.Text = "live"
Else
Record.Text = "Admitted"
End If
End If
End If
Adodc1.Recordset.MoveNext
Wend
End If
End If
End If
End If
Else
If Option1(1).Value = True Then
If Combo2.Text = "Select Media" Then
MsgBox ("Please Select Media")
inv = 1
Else
Adodc1.Recordset.MoveFirst
Record.Row = 0
While Adodc1.Recordset.EOF = False
Record.Col = 0
If Combo2.Text = Adodc1.Recordset.Fields(8) Then
Record.Visible = True
Record.Row = Record.Row + 1
Record.Rows = Record.Rows + 1
Record.Text = Adodc1.Recordset.Fields(0)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(1)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(2)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(3)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(4)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(5)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(6)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(7)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(8)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(9)
Record.Col = Record.Col + 1
If Adodc1.Recordset.Fields(11) = "l" Then
Record.Text = "live"
Else
Record.Text = "Admitted"
End If
End If
Adodc1.Recordset.MoveNext
Wend
End If
Else
If Option1(2).Value = True Then
If Combo3.Text = "Select Area" Then
MsgBox ("Please Select Area Code")
inv = 1
Else
Adodc1.Recordset.MoveFirst
Record.Row = 0
While Adodc1.Recordset.EOF = False
Record.Col = 0
If Combo3.Text = Adodc1.Recordset.Fields(4) Then
Record.Visible = True
Record.Row = Record.Row + 1
Record.Rows = Record.Rows + 1
Record.Text = Adodc1.Recordset.Fields(0)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(1)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(2)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(3)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(4)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(5)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(6)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(7)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(8)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(9)
Record.Col = Record.Col + 1
If Adodc1.Recordset.Fields(11) = "l" Then
Record.Text = "live"
Else
Record.Text = "Admitted"
End If
End If
Adodc1.Recordset.MoveNext
Wend
End If
Else
If Combo4.Text = "mm" Or Combo5.Text = "dd" Or Combo6.Text = "yyyy"
Then
MsgBox ("Invalid Date")
inv = 1
Else
Adodc1.Recordset.MoveFirst
Record.Row = 0
While Adodc1.Recordset.EOF = False
Record.Col = 0
If Combo4.ListIndex + 1 & "/" & Combo5.Text & "/" & Combo6.Text =
Adodc1.Recordset.Fields(1) Then
Record.Visible = True
Record.Row = Record.Row + 1
Record.Rows = Record.Rows + 1
Record.Text = Adodc1.Recordset.Fields(0)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(1)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(2)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(3)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(4)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(5)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(6)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(7)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(8)
Record.Col = Record.Col + 1
Record.Text = Adodc1.Recordset.Fields(9)
Record.Col = Record.Col + 1
If Adodc1.Recordset.Fields(11) = "l" Then
Record.Text = "live"
Else
Record.Text = "Admitted"
End If
End If
Adodc1.Recordset.MoveNext
Wend
End If
End If
End If
End If
Label2.Caption = Record.Rows - 2
Record.Rows = Record.Rows - 1
If Label2.Caption = 0 And inv = 0 Then
MsgBox ("Record Not Found")
Record.Visible = False
End If
End Sub

Private Sub Command2_Click()


Unload Me
search.Hide
Load Form2
Form2.Show
End Sub

Private Sub Command3_Click()


Me.Hide
Form2.Show
End Sub

Private Sub Form_Load()


Record.Visible = False
Frame1.Visible = False
Adodc1.Recordset.MoveFirst
For i = 0 To 1
Option2(i).Visible = False
Check1.Visible = False
Check2.Visible = False
Next
Combo1.Visible = False
Combo2.Visible = False
Combo3.Visible = False
Combo4.Visible = False
Combo5.Visible = False
Combo6.Visible = False
End Sub
Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0
For i = 0 To 1
Option2(i).Visible = True
Next
Check1.Visible = True
Check2.Visible = True
Combo1.Visible = True
Combo2.Visible = False
Combo3.Visible = False
Combo4.Visible = False
Combo5.Visible = False
Combo6.Visible = False
Frame1.Visible = True
Combo2.List(0) = "Newspaper"
Combo2.List(1) = "Magazine"
Combo2.List(2) = "Friends"
Combo2.List(3) = "Pamphlets"
Combo2.List(4) = "Television"
Combo2.List(5) = "Others"
Case 1
For i = 0 To 1
Option2(i).Visible = False
Next
Record.Visible = False
Check1.Visible = False
Check2.Visible = False
Combo1.Visible = False
Combo3.Visible = False
Combo4.Visible = False
Combo5.Visible = False
Combo6.Visible = False
Combo2.Visible = True
Frame1.Visible = False
Case 2
For i = 0 To 1
Option2(i).Visible = False
Next
Record.Visible = False
Check1.Visible = False
Check2.Visible = False
Combo1.Visible = False
Combo2.Visible = False
Combo4.Visible = False
Combo5.Visible = False
Combo6.Visible = False
Combo3.Visible = True
Frame1.Visible = False
If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MoveFirst
While Adodc1.Recordset.EOF = False
var = 0
For i = 0 To Combo3.ListCount
If Adodc1.Recordset.Fields(4) = Combo3.List(i) Then
var = 1
End If
Next
If var = 0 Then
Combo3.List(i - 1) = Adodc1.Recordset.Fields(4)
End If
Adodc1.Recordset.MoveNext
Wend
End If
Combo3.Text = "Select Area"
Case 3
For i = 0 To 1
Option2(i).Visible = False
Next
Record.Visible = False
Check1.Visible = False
Check2.Visible = False
Combo1.Visible = False
Combo2.Visible = False
Combo3.Visible = False
Combo4.Visible = True
Combo5.Visible = True
Combo6.Visible = True
Frame1.Visible = False
Combo4.Text = "mm"
Combo5.Text = "dd"
Combo6.Text = "yyyy"
End Select
End Sub

Private Sub Option2_Click(Index As Integer)


Select Case Index
Case 0
Combo1.List(0) = "Web Engineering"
Combo1.List(1) = "Info.Tech.- I Year"
Combo1.List(2) = "Info.Tech.- II Year"
Combo1.List(3) = "E-Commerce"
Combo1.List(4) = "H/W and Networking"
Combo1.List(5) = "Comp.App.& Multilingual DTP"
Combo1.List(6) = "Computer Programming"
Combo1.Text = "Select One"
Case 1
Combo1.List(0) = "Fashion Designing"
Combo1.List(1) = "MSCIT"
Combo1.List(2) = "Financial Accounting"
Combo1.List(3) = "Computer Animation"
Combo1.List(4) = "Oracle"
Combo1.List(5) = "Visual Basic"
Combo1.List(6) = "DTP"
Combo1.List(7) = "Office Applications"
Combo1.List(8) = "MCSE Window2000"
Combo1.List(9) = "CCNA"
Combo1.List(10) = "Linux"
Combo1.List(11) = "Mobile Repairing"
Combo1.Text = "Select One"
End Select
End Sub

You might also like