Source Code of RAILWAY RESERVATION SYSTEM IN VB6.0
Source Code of RAILWAY RESERVATION SYSTEM IN VB6.0
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
Select Case ProgressBar1.Value
Case "10"
Label1.Caption = "LOADING..."
Case "35"
Label1.Caption = "OPENING DATABASE..."
Case "65"
Label1.Caption = "CHECKING CONNECTIVITY..."
Case "90"
Label1.Caption = " Created By--PRAKHAR AGRAWAL"
Case "100"
Unload Me
ABOUTUS.Show
End Select
End Sub
Private Sub Image3_Click()
LOGIN.Show
Unload Me
End Sub
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i As Integer
Dim chk As Integer
Private Sub cmdOK_Click()
chk = True
If Combo1.Text = "" And txtPassword.Text = "" Or Combo1.Text = "" Or txtPassword.Text
= "" Then
MsgBox ("You cannot blank User Name or Password"), vbCritical, "Error"
Else
Adodc1.Recordset.MoveFirst
For i = 0 To Adodc1.Recordset.RecordCount - 1
If Combo1.Text = Adodc1.Recordset.Fields("Username") And txtPassword.Text =
Adodc1.Recordset.Fields("Password") Then
chk = False
MDIForm1.Show
Me.Hide
Exit For
Else
Adodc1.Recordset.MoveNext
End If
Next
If chk = True Then
MsgBox ("Please enter the correct username and password"), vbExclamation, "Error"
Combo1.Text = ""
txtPassword.Text = ""
Combo1.SetFocus
End If
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
Dialog.Show
Me.Hide
End Sub
Private Sub Command2_Click()
REGISTRATION.Show
Me.Hide
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.ConnectionString = "Data Source=" & App.Path & "\Database2.mdb"
con.Open
rs.Open "select distinct Username from loginsignup", con, adOpenDynamic,
adLockOptimistic, adCmdText
While rs.EOF = False
Combo1.AddItem rs.Fields(0)
rs.MoveNext
Wend
rs.Close
End Sub
Private Sub Timer1_Timer()
If (Label3.Left + Label3.Width) <= 0 Then
Label3.Left = Me.Width
End If
Label3.Left = Label3.Left - 25
End Sub
Private Sub Timer2_Timer()
If (Image6.Top + Image6.Width) <= 0 Then
Image6.Top = Me.Width
End If
Image6.Top = Image6.Top - 25
End Sub
Private Sub Timer3_Timer()
If (Label4.Left + Label4.Width) <= 0 Then
Label4.Left = Me.Width
End If
Label4.Left = Label4.Left - 25
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo6_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
Adodc2.Recordset.AddNew
Adodc2.Recordset.Fields("Username") = Text1.Text
Adodc2.Recordset.Fields("Password") = Text2.Text
Adodc2.Recordset.Fields("SQuestion") = Combo1.Text
Adodc2.Recordset.Fields("Gender") = Combo2.Text
Adodc2.Recordset.Fields("YAns") = Text3.Text
Adodc2.Recordset.Fields("Martial Status") = Combo7.Text
Adodc2.Recordset.Fields("Occupation") = Combo6.Text
Adodc2.Recordset.Fields("Date of Birth") = DTPicker1.Value
Adodc2.Recordset.Fields("Aadhaar Card No") = Text4.Text
Adodc2.Recordset.Fields("E-Mail") = Text5.Text
Adodc2.Recordset.Fields("Mobile No") = Text6.Text
Adodc2.Recordset.Fields("Address") = Text7.Text
Adodc2.Recordset.Fields("Pin Code") = Text8.Text
Adodc2.Recordset.Save
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text6.Text = "" Or Text7.Text =
"" Or Text8.Text = "" Or Combo1 = "" Or Combo2 = "" Or Combo7 = "" Or Combo6 = "" Or
DTPicker1 = "" Then
MsgBox "Some * fields are left Blank, Please fill Them", vbExclamation, "Error"
Exit Sub
End If
MsgBox ("Record is successfully submitted"), vbMsgBoxSetForeground, "Success"
Form3.Show
Unload Me
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo6.Text = ""
Combo7.Text = ""
Text1.SetFocus
End Sub
Private Sub Form_Load()
Combo1.AddItem "What is your pets name?"
Combo1.AddItem "Who was your childhood hero?"
Combo1.AddItem "What is your favorite pass-time?"
Combo1.AddItem "What make was your Favorite sports team?"
Combo1.AddItem "What is your favorite clothes brand?"
Combo1.AddItem "What was the name of your first school"
Combo1.AddItem "Name the person whom u want's to copy?"
Combo2.AddItem "Male"
Combo2.AddItem "Female"
Combo6.AddItem "Government"
Combo6.AddItem "Public"
Combo6.AddItem "Private"
Combo6.AddItem "Professional"
Combo6.AddItem "Employed"
Combo6.AddItem "Student"
Combo6.AddItem "Other"
Combo7.AddItem "Married"
Combo7.AddItem "Unmarried"
Combo7.AddItem "Divorced"
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Option Explicit
Private Sub newreg_Click()
Form13.Show
Unload Me
End Sub
Private Sub Picture1_Click()
End Sub
Private Sub Abtus_Click()
ABOUTUS.Show
Me.Hide
End Sub
Private Sub contact_Click()
Contactus.Show
Me.Hide
End Sub
Private Sub exit_Click()
Dialog.Show
Me.Hide
End Sub
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub Combo1_Click()
Combo2.Clear
rs.Open "select distinct Destination from delhi where Source='" & Combo1.Text & "'", con,
adOpenDynamic, adLockOptimistic, adCmdText
While rs.EOF = False
Combo2.AddItem rs.Fields(0)
rs.MoveNext
Wend
rs.Close
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo2_GotFocus()
If Combo1.Text = "" Then
MsgBox "Please select the train to move forward ", vbExclamation, "Error"
Combo1.SetFocus
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MSHFlexGrid1.Visible = True
rs.Open "select * from delhi where Source='" & Combo1.Text & "' and Destination='" &
Combo2.Text & "'", con, adOpenDynamic, adLockOptimistic, adCmdText
Set Form3.MSHFlexGrid1.DataSource = rs
rs.Close
Else
End If
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo3_Click()
search.SetFocus
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Command2_Click()
Combo1.Text = ""
Combo2.Text = ""
Combo4.Text = ""
End Sub
Private Sub DTPicker1_GotFocus()
If Combo2.Text = "" Then
MsgBox "Please select the Train to move forward ", vbExclamation, "Error"
Combo2.SetFocus
End If
End Sub
Private Sub DTPicker2_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As
Integer, ByVal CallbackField As String, CallbackDate As Date)
DTPicker1 = DTPicker2
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.ConnectionString = "Data Source=" & App.Path & "\Database2.mdb"
con.Open
rs2.Open "select distinct Source from delhi", con, adOpenDynamic, adLockOptimistic,
adCmdText
While rs2.EOF = False
Combo1.AddItem rs2.Fields(0)
rs2.MoveNext
Wend
rs2.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
con.Close
End Sub
Private Sub Picture3_Click(Index As Integer)
If Combo3.Text = "" Or Combo2.Text = "" Or Combo1.Text = "" Or Label9 = "" Then
MsgBox " Fill Full Details ", vbCritical, "Error"
Combo1.SetFocus
Else
If Not Combo3.Text = "" Then
Form2.Label3 = Label9
Form2.Label5 = Label10
Form2.Label13 = DTPicker1
Form2.Label9 = Label11
Form2.Label11 = Combo3.Text
Form2.Label13 = Label12
Form5.Label22 = Label9
Form5.Label13 = Label10
Form5.Label23 = DTPicker1
Form5.Label24 = Label11
Form5.Label21 = Combo3.Text
Form5.Label20 = Label12
Form5.Label55 = Text1.Text
Form11.Label22 = Label9
Form11.Label28 = Label10
Form11.Label29 = DTPicker1
Form11.Label30 = Text5.Text
Form11.Label24 = Label11
Form11.Label25 = Combo3.Text
Form12.Label22 = Label9
Form12.Label28 = Label10
Form12.Label29 = DTPicker1
Form12.Label30 = Text5.Text
Form12.Label24 = Label11
Form12.Label25 = Combo3.Text
Form12.Label26 = Text4.Text
Form5.Label21 = Combo3.Text
Form2.Show
Unload Me
Unload Me
End If
End If
End Sub
Private Sub search_Click()
If Combo1.Text <> "" And Combo2.Text <> "" Then
Label10 = Combo1.Text
Label11 = Combo2.Text
End If
rs.Open "select * from delhi where Source='" & Combo1.Text & "' and Destination='" &
Combo2.Text & "'", con, adOpenDynamic, adLockOptimistic, adCmdText
Set Label9.DataSource = rs
Set Text2.DataSource = rs
Set Text4.DataSource = rs
Set Text5.DataSource = rs
Text2.DataField = "Availiblity"
Text4.DataField = "PNR No"
Text5.DataField = "Transaction _ID"
Form5.Label58 = Text2.Text
Label9.DataField = "TrainName"
If Combo1.Text = " " And Combo2.Text = "" And Combo4.Text = "" And DTPicker1 = ""
Or Combo1.Text = " " Or Combo2.Text = "" Or Combo4.Text = "" Or DTPicker1 = "" Then
MsgBox (" Fill Full Details "), vbCritical, "Error"
Combo1.Text = ""
Combo2.Text = ""
Combo4.Text = ""
Combo1.SetFocus
End If
Label12 = Combo4.Text
Label13 = DTPicker1
End Sub
Private Sub Timer1_Timer()
Label7.Caption = Date
Label8.Caption = Time
End Sub
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub Adodc1_Click()
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo1_LostFocus()
Picture2.Visible = True
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo2_LostFocus()
If Text2.Text >= 60 Then
Check1.Value = 1
Check1.Visible = True
Form5.Label45 = "Yes"
Else: Check1.Value = False
Check1.Visible = True
Form5.Label45 = "No"
End If
If Not Combo2 = "" Then
Frame1.Visible = False
End If
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo4_Click()
If Text3.Text = "" Or Combo3 = "" Then
MsgBox " Please fill your full Details in S.No '2'", vbExclamation, "Error"
Text3.SetFocus
End If
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo4_LostFocus()
If Text4.Text >= 60 Then
Check2.Value = 1
Check2.Visible = True
Form5.Label41 = "Yes"
Else: Check2.Value = False
Check1.Visible = True
Form5.Label41 = "No"
End If
If Not Combo4 = "" Then
Frame2.Visible = False
Form5.Frame1.Visible = False
End If
If Not Combo4 = "" Then
Frame2.Visible = False
Form11.Frame1.Visible = False
End If
If Not Combo4 = "" Then
Frame2.Visible = False
Form12.Frame1.Visible = False
End If
End Sub
Private Sub Combo5_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo6_Click()
If Text5.Text = "" Or Combo5 = "" Then
MsgBox " Please fill your full Details in S.No '3'", vbExclamation, "Error"
Text5.SetFocus
End If
End Sub
Private Sub Combo6_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo6_LostFocus()
If Text6.Text >= 60 Then
Check4.Value = 1
Check4.Visible = True
Form5.Label37 = "Yes"
Else: Check4.Value = False
Check4.Visible = True
Form5.Label37 = "No"
End If
If Not Combo6 = "" Then
Frame3.Visible = False
Form5.Frame2.Visible = False
End If
If Not Combo6 = "" Then
Frame3.Visible = False
Form11.Frame2.Visible = False
End If
If Not Combo6 = "" Then
Frame3.Visible = False
Form12.Frame2.Visible = False
End If
End Sub
Private Sub Combo7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo8_Click()
If Text7.Text = "" Or Combo7 = "" Then
MsgBox " Please fill your full Details in S.No '2'", vbExclamation, "Error"
Text7.SetFocus
End If
End Sub
Private Sub Combo8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Combo8_LostFocus()
If Text8.Text >= 60 Then
Check5.Value = 1
Check5.Visible = True
Form5.Label33 = "Yes"
Else: Check5.Value = False
Check5.Visible = True
Form5.Label33 = "No"
End If
If Combo8 = "" Then
MsgBox " Fill the column", vbQuestion, "Error"
Combo8.SetFocus
End If
Form5.Frame3.Visible = False
Form11.Frame3.Visible = False
Form12.Frame3.Visible = False
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
Combo6.Text = ""
Combo7.Text = ""
Combo8.Text = ""
Check1.Value = 2
Check2.Value = 2
Check4.Value = 2
Check5.Value = 2
End Sub
Private Sub Command5_Click()
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.ConnectionString = "Data Source=" & App.Path & "\Database2.mdb"
con.Open
rs.Open "select distinct Source from delhi", con, adOpenDynamic, adLockOptimistic,
adCmdText
rs.MoveNext
rs.Close
Combo1.AddItem "Male"
Combo1.AddItem "Female"
Combo2.AddItem "Upper"
Combo2.AddItem "Middle"
Combo2.AddItem "Lower"
Combo2.AddItem "Side Upper"
Combo2.AddItem "Side Lower"
Combo3.AddItem "Male"
Combo3.AddItem "Female"
Combo4.AddItem "Upper"
Combo4.AddItem "Middle"
Combo4.AddItem "Lower"
Combo4.AddItem "Side Upper"
Combo4.AddItem "Side Lower"
Combo5.AddItem "Male"
Combo5.AddItem "Female"
Combo6.AddItem "Upper"
Combo6.AddItem "Middle"
Combo6.AddItem "Lower"
Combo6.AddItem "Side Upper"
Combo6.AddItem "Side Lower"
Combo7.AddItem "Male"
Combo7.AddItem "Female"
Combo8.AddItem "Upper"
Combo8.AddItem "Middle"
Combo8.AddItem "Lower"
Combo8.AddItem "Side Upper"
Combo8.AddItem "Side Lower"
End Sub
Private Sub Picture2_Click()
rs.Open "select * from delhi where Source='" & Label5 & "' and Destination='" & Label9 &
"'", con, adOpenDynamic, adLockOptimistic, adCmdText
Set Text16.DataSource = rs
Set Text12.DataSource = rs
Text16.DataField = "Senior Citizen"
Text12.DataField = "Adult"
rs.Close
Form5.Label32 = Text1.Text
Form5.Label48 = Text2.Text
Form5.Label47 = Combo1.Text
Form5.Label46 = Combo2.Text
Form5.Label31 = Text3.Text
Form5.Label44 = Text4.Text
Form5.Label43 = Combo3.Text
Form5.Label42 = Combo4.Text
Form5.Label30 = Text5.Text
Form5.Label40 = Text6.Text
Form5.Label39 = Combo5.Text
Form5.Label38 = Combo6.Text
Form5.Label29 = Text7.Text
Form5.Label36 = Text8.Text
Form5.Label35 = Combo7.Text
Form5.Label34 = Combo8.Text
Form11.Label45 = Text1.Text
Form11.Label48 = Text2.Text
Form11.Label44 = Text3.Text
Form11.Label46 = Text4.Text
Form11.Label43 = Text5.Text
Form11.Label42 = Text6.Text
Form11.Label39 = Text7.Text
Form11.Label38 = Text8.Text
Form11.Label49 = Combo1.Text
Form11.Label47 = Combo3.Text
Form11.Label41 = Combo5.Text
Form11.Label37 = Combo7.Text
Form12.Label45 = Text1.Text
Form12.Label48 = Text2.Text
Form12.Label44 = Text3.Text
Form12.Label46 = Text4.Text
Form12.Label43 = Text5.Text
Form12.Label42 = Text6.Text
Form12.Label39 = Text7.Text
Form12.Label38 = Text8.Text
Form12.Label49 = Combo1.Text
Form12.Label47 = Combo3.Text
Form12.Label41 = Combo5.Text
Form12.Label37 = Combo7.Text
Form12.Label56 = Text10.Text
Form12.Label19 = Text9.Text
If Check1.Value = 1 And Check2.Value = 1 And Check4.Value = 1 And Check5.Value = 1
Then
Text15.Text = 4
Else
If Check1.Value = 1 And Check2.Value = 1 And Check4.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check2.Value = 1 And Check5.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check4.Value = 1 And Check5.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check4.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check5.Value = 1 And Check4.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check5.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check1.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check1.Value = 1 And Check5.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check2.Value = 1 And Check5.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check2.Value = 1 And Check1.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check5.Value = 1 And Check1.Value = 1 Then
Text15.Text = 3
Else
If Check4.Value = 1 And Check5.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check1.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check1.Value = 1 And Check4.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check2.Value = 1 And Check4.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check2.Value = 1 And Check1.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check4.Value = 1 And Check1.Value = 1 Then
Text15.Text = 3
Else
If Check5.Value = 1 And Check4.Value = 1 And Check2.Value = 1 Then
Text15.Text = 3
Else
If Check1.Value = 1 And Check2.Value = 1 Then
Text15.Text = 2
Else
If Check1.Value = 1 And Check4.Value = 1 Then
Text15.Text = 2
Else
If Check1.Value = 1 And Check5.Value = 1 Then
Text15.Text = 2
Else
If Check4.Value = 1 And Check2.Value = 1 Then
Text15.Text = 2
Else
If Check4.Value = 1 And Check1.Value = 1 Then
Text15.Text = 2
Else
If Check4.Value = 1 And Check5.Value = 1 Then
Text15.Text = 2
Else
If Check5.Value = 1 And Check1.Value = 1 Then
Text15.Text = 2
Else
If Check5.Value = 1 And Check4.Value = 1 Then
Text15.Text = 2
Else
If Check5.Value = 1 And Check2.Value = 1 Then
Text15.Text = 2
Else
If Check1.Value = 1 Or Check2.Value = 1 Or Check4.Value = 1 Or Check5.Value = 1 Then
Text15.Text = 1
Else
Text15.Text = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
If Check1.Value = 0 And Check2.Value = 0 And Check4.Value = 0 And Check5.Value = 0
Then
Text11.Text = 4
Else
If Check1.Value = 0 And Check2.Value = 0 And Check4.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check2.Value = 0 And Check5.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check4.Value = 0 And Check5.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check4.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check5.Value = 0 And Check4.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check5.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check1.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check1.Value = 0 And Check5.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check2.Value = 0 And Check5.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check2.Value = 0 And Check1.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check5.Value = 0 And Check1.Value = 0 Then
Text11.Text = 3
Else
If Check4.Value = 0 And Check5.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check1.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check1.Value = 0 And Check4.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check2.Value = 0 And Check4.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check2.Value = 0 And Check1.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check4.Value = 0 And Check1.Value = 0 Then
Text11.Text = 3
Else
If Check5.Value = 0 And Check4.Value = 0 And Check2.Value = 0 Then
Text11.Text = 3
Else
If Check1.Value = 0 And Check2.Value = 0 Then
Text11.Text = 2
Else
If Check1.Value = 0 And Check4.Value = 0 Then
Text11.Text = 2
Else
If Check1.Value = 0 And Check5.Value = 0 Then
Text11.Text = 2
Else
If Check2.Value = 0 And Check5.Value = 0 Then
Text11.Text = 2
Else
If Check2.Value = 0 And Check4.Value = 0 Then
Text11.Text = 2
Else
If Check2.Value = 0 And Check1.Value = 0 Then
Text11.Text = 2
Else
If Check4.Value = 0 And Check2.Value = 0 Then
Text11.Text = 2
Else
If Check4.Value = 0 And Check1.Value = 0 Then
Text11.Text = 2
Else
If Check4.Value = 0 And Check5.Value = 0 Then
Text11.Text = 2
Else
If Check5.Value = 0 And Check1.Value = 0 Then
Text11.Text = 2
Else
If Check5.Value = 0 And Check4.Value = 0 Then
Text11.Text = 2
Else
If Check5.Value = 0 And Check2.Value = 0 Then
Text11.Text = 2
Else
If Check1.Value = 0 Or Check2.Value = 0 Or Check4.Value = 0 Or Check5.Value = 0 Then
Text11.Text = 1
Else
Text11.Text = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
If Text1.Text = "" Or Text2.Text = "" Or Text9.Text = "" Or Text10.Text = "" Or Combo1 =
"" Or Combo2.Text = "" Then
MsgBox " Some Compulsary Fields are left blank!!!", vbExclamation, "Error"
End If
Text13.Text = (Text11.Text * Text12.Text) + (Text15.Text * Text16.Text)
Text14.Text = Text11.Text * Text12.Text + Text15.Text * Text16.Text + 10
Form5.Label57 = Text14.Text
Form5.Label55 = Text13.Text
Form12.Label64 = Text13.Text
Form12.Label62 = Text14.Text
End Sub
Private Sub Picture2_DblClick()
If Check1.Value = 1 Then
Form5.Label51 = Text16.Text
Else
Form5.Label51 = Text12.Text
End If
If Check2.Value = 1 Then
Form5.Label52 = Text16.Text
Else
Form5.Label52 = Text12.Text
End If
If Check4.Value = 1 Then
Form5.Label53 = Text16.Text
Else
Form5.Label53 = Text12.Text
End If
If Check5.Value = 1 Then
Form5.Label54 = Text16.Text
Else
Form5.Label54 = Text12.Text
End If
If Text1.Text = "" Or Text2.Text = "" Or Text9.Text = "" Or Text10.Text = "" Or Combo1 =
"" Or Combo2.Text = "" Then
MsgBox " Some Compulsary Fields are left blank!!!", vbExclamation, "Error"
Else: Form5.Show
End If
Unload Me
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Dim X, Y As Integer
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim con As New ADODB.Connection
Private Sub Combo1_Change()
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
If Not (KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or (KeyAscii >= Asc("A") And
KeyAscii <= Asc("Z") Or KeyAscii = Asc(vbBack))) Then
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
Form3.Show
Unload Me
End Sub
Private Sub Command2_Click()
rs.Open "select * from delhi where Source='" & Label13 & "' and Destination='" & Label24
& "'", con, adOpenDynamic, adLockOptimistic, adCmdText
Set Text1.DataSource = rs
Set Text2.DataSource = rs
Text1.DataField = "Seat No"
Text2.DataField = "Coach No"
rs.Close
Form11.Label27 = Text1.Text
Form12.Label21 = Text2.Text
Form11.Label21 = Text2.Text
Form12.Label27(0) = Text1.Text
If Combo1.Text = "HDFC Bank" Then
Form10.Show
End If
If Combo1.Text = "Punjab National Bank" Then
Form7.Show
End If
If Combo1.Text = "Axis Bank" Then
form8.Show
End If
If Combo1.Text = "SBI Bank" Then
Form9.Show
End If
Form7.Label11 = Label57
form8.Label11 = Label57
Form9.Label11 = Label57
Form10.Label11 = Label57
Form11.Label17 = Label57
Form11.Label32 = Label45
Form11.Label33 = Label41
Form11.Label34 = Label37
Form11.Label35 = Label33
Form12.Label62 = Label57
Unload Me
End Sub
Private Sub Command3_Click()
Form3.Combo1.Text = " "
Form3.Combo2.Text = " "
Form3.Combo4.Text = " "
Form3.Text1.Text = " "
Form3.Text2.Text = " "
Form3.Combo3.Text = " "
Form2.Text1.Text = ""
Form2.Text2.Text = ""
Form2.Text3.Text = ""
Form2.Text4.Text = ""
Form2.Text5.Text = ""
Form2.Text6.Text = ""
Form2.Text7.Text = ""
Form2.Text8.Text = ""
Form2.Combo1.Text = ""
Form2.Combo2.Text = ""
Form2.Combo3.Text = ""
Form2.Combo4.Text = ""
Form2.Combo5.Text = ""
Form2.Combo6.Text = ""
Form2.Combo7.Text = ""
Form2.Combo8.Text = ""
Form2.Label3 = ""
Form2.Label5 = ""
Form2.Label7 = ""
Form2.Label9 = ""
Form2.Label11 = ""
Label20 = ""
Label22 = ""
Label21 = ""
Label24 = ""
Label13 = ""
Form3.Show
Unload Me
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.ConnectionString = "Data Source=" & App.Path & "\Database2.mdb"
con.Open
rs.Open "select distinct Source from delhi", con, adOpenDynamic, adLockOptimistic,
adCmdText
rs.Close
End Sub
Private Sub Command1_Click()
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text =
"" Or Text7.Text = "" Or Text9.Text = "" Then
MsgBox "Some fields are Missing ", vbExclamation, "Error"
Text2.SetFocus
Else:
Form11.Show
Unload Me
End If
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Me
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Timer1_Timer()
If (Label9.Left + Label9.Width) <= 0 Then
Label9.Left = Me.Width
End If
Label9.Left = Label9.Left - 25
End Sub
Private Sub Command1_Click()
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text =
"" Or Text7.Text = "" Or Text9.Text = "" Then
MsgBox "Some fields are Missing ", vbExclamation, "Error"
Text2.SetFocus
Else: Form11.Show
Unload Me
End If
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Me
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Timer1_Timer()
If (Label9.Left + Label9.Width) <= 0 Then
Label9.Left = Me.Width
End If
Label9.Left = Label9.Left - 25
End Sub
Private Sub Command1_Click()
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text =
"" Or Text7.Text = "" Or Text9.Text = "" Then
MsgBox "Some fields are Missing ", vbExclamation, "Error"
Text2.SetFocus
Else: Form11.Show
Unload Me
End If
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Me
End Sub
Private Sub Timer1_Timer()
If (Label9(1).Left + Label9(1).Width) <= 0 Then
Label9(1).Left = Me.Width
End If
Label9(1).Left = Label9(1).Left - 25
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub logout_Click()
LOGIN.Show
Me.Hide
End Sub
Private Sub TRP_Click()
Form3.Show
Unload Me
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Command1_Click()
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text =
"" Or Text7.Text = "" Or Text1.Text = "" Or Text9.Text = "" Then
MsgBox "Some fields are Missing ", vbExclamation, "Error"
Text2.SetFocus
Else:
Form11.Show
Unload Me
End If
End Sub
Private Sub Command2_Click()
Form5.Show
Unload Me
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(vbBack)) Then
KeyAscii = 0
End If
End Sub
Private Sub Timer1_Timer()
If (Label9.Left + Label9.Width) <= 0 Then
Label9.Left = Me.Width
End If
Label9.Left = Label9.Left - 25
End Sub
Private Sub Command1_Click()
Form12.Show
Unload Me
End Sub
Private Sub Command2_Click()
MDIForm1.Show
Me.Hide
End Sub
Private Sub Timer1_Timer()
If (Label1.Left + Label1.Width) <= 0 Then
Label1.Left = Me.Width
End If
Label1.Left = Label1.Left - 25
End Sub
Private Sub Command1_Click()
Dim BeginPage, EndPage, NumCopies, Orientation, i
' Set Cancel to True.
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Display the Print dialog box.
CommonDialog1.ShowPrinter
' Get user-selected values from the dialog box.
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
Orientation = CommonDialog1.Orientation
For i = 1 To NumCopies
' Put code here to send data to your printer.
Next
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Label5_Click()
Unload Me
Dialog.Show
End Sub