hello please help me on this how to put the messagebox if the precinct number is not found,,.because if i put on the else after the grd.Rows = grd.Rows + 1 he will only display one person having this precint number all i want that all person having the precint number will be display.here are the list....D-314 is the precinct number...hoping for your positive responds.thanks in advance....
"D-314","England","0001","michael","lambert","s","london",26
"C-245","America","0002","deca","fischer","s","california",29
"D-314","China","0003","Miller","anna","s","new zealand",21
"C-245","Belgium","0004","fullinto","fanley","s","iceland",22
"D-314","Norway","0005","jerusalem","emmanuel","s","Nazareth",25
"D-314","Singapore","0006","hhhhh","nave`","d","Africa",29
"C-245","Thailand","0007","ggg","yyyyyy","s","uptown",30
"E-344","Brunei","0008","llllll","l;k;lk;l","d","new town",29
"D-314","United Kingdom","0009","jlkjlkjl","qlkjlkjlk","s","lkjlkj",26
"C-245","Africa","0010","ffff","ff","f","ff",34
"C-245","Laos","0011","fdfdfdf","fff","s","f",67
"A-342","Harvard","0012","fff","f","f","f",23
"D-314","Korea","0013","rrrrrr","ssss","k","kkk",22
////here is my code
Private Sub cmdExit_Click()
End
End Sub
Public Sub header()
grd.Clear
grd.Rows = 2
grd.Cols = 4
grd.ColWidth(1) = 2000
grd.ColWidth(2) = 1500
With grd
.TextMatrix(0, 0) = "Voters idno"
.TextMatrix(0, 1) = "Voters name"
.TextMatrix(0, 2) = "address"
.TextMatrix(0, 3) = "age"
End With
End Sub
Private Sub Form_Load()
header
End Sub
Private Sub txtpno_KeyDown(KeyCode As Integer, Shift As Integer)
gFnum = FreeFile
If KeyCode = 13 Then
m_pno = Trim(UCase(txtpno.Text))
txtpno.SetFocus
Open "voters.dat" For Input As #gFnum
Do Until EOF(gFnum)
Input #gFnum, pn, adress, vidno, last, first, middle, address, age
If m_pno = pn Then
With grd
.TextMatrix(grd.Rows - 1, 0) = vidno
.TextMatrix(grd.Rows - 1, 1) = last + "," + first + "" + middle
.TextMatrix(grd.Rows - 1, 2) = address
.TextMatrix(grd.Rows - 1, 3) = age
End With
grd.Rows = grd.Rows + 1
End If
Loop
Close #gFnum
End If
End Sub
- Add new comment
- 10 views