Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

PLEASE HELP me!!NO result appeared in my work...

i connect it with database...I use an array for getting the result...please debug my prog..diz is my code on the array.vb code!

Dim conn As Connection
Dim rssearch As Recordset
Dim act1 As String
Dim act2 As String
Dim loc As String
Dim trans As String
Dim chus As String
Dim bud1 As String
Dim bud2 As String
Dim los1 As String
Dim los2 As String
Dim X As Integer
Public Sub chk_Click(Index As Integer)

Select Case Index
Case 0
If chk(Index).Value = 1 Then
frm_island.Visible = True
cmbisland.Visible = True
Else
frm_island.Visible = False
cmbisland.Visible = False
End If
Case 1
If chk(Index).Value = 1 Then
frm_transpo.Visible = True
cmbtranspo.Visible = True
Else
frm_transpo.Visible = False
cmbtranspo.Visible = False
End If
Case 2
If chk(Index).Value = 1 Then
frmactivity.Visible = True
cmbactivity1.Visible = True
Else
frmactivity.Visible = False
cmbactivity1.Visible = False
End If
Case 3
If chk(Index).Value = 1 Then
frmactivity2.Visible = True
cmbactivity2.Visible = True
Else
frmactivity2.Visible = False
cmbactivity2.Visible = False
End If
Case 4
If chk(Index).Value = 1 Then
Frmchus.Visible = True
cmbchus.Visible = True
Else
Frmchus.Visible = False
cmbchus.Visible = False
End If
Case 5
If chk(Index).Value = 1 Then
frmloc.Visible = True
cmblocation.Visible = True
Else
frmloc.Visible = False
cmblocation.Visible = False
End If
Case 6
If chk(Index).Value = 1 Then
frmLOS.Visible = True
cmbLOS.Visible = True
cmbmnth.Visible = True
lblday.Visible = True
lblmnth.Visible = True
Else
frmLOS.Visible = False
cmbLOS.Visible = False
cmbmnth.Visible = False
lblday.Visible = False
lblmnth.Visible = False
End If
Case 7
If chk(Index).Value = 1 Then
frmbudget.Visible = True
cmbbudget1.Visible = True
cmbbudget2.Visible = True
lbl8.Visible = True
lbl5.Visible = True
Else
frmbudget.Visible = False
cmbbudget1.Visible = False
cmbbudget2.Visible = False
lbl8.Visible = False
lbl5.Visible = False
End If
End Select
End Sub
Public Sub cmdEXIT_Click()
End
End Sub
Public Sub cmdOK_Click()

If cmbtranspo.Text <> "" Then
trans = "transpo1 or transpo2 or transpo3 or transpo4 like '%" + cmbtranspo.Text + "%'"
End If

If cmbactivity1.Text <> "" Then
act1 = "activity1 or activity2 or activity3 or activity4 like '%" + cmbactivity1.Text + "%'"
End If

If cmbactivity2.Text <> "" Then
act2 = "activity1 or activity2 or activity3 or activity4 like '%" + cmbactivity2.Text + "%'"
End If

If cmbchus.Text <> "" Then
chus = "wat like '%" + cmbchus.Text + "%'"
End If

If cmblocation.Text <> "" Then
loc = "place like '%" + cmblocation.Text + "%'"
End If

If cmbLOS.Text <> "" Then
los = "lostay_day like '%" + cmbLOS.Text + "%'"
End If

If cmbmnth.Text <> "" Then
los1 = "lostay_month like '%" + cmbmnth.Text + "%'"
End If

If cmbbudget1.Text <> "" Then
bud1 = "budget1 like or < '%" + cmbbudget1.Text + "%'"
End If

If cmbbudget2.Text <> "" Then
bud2 = "budget2 like or < '%" + cmbbudget2.Text + "%'"
End If

If cmbisland.Text <> "" Then
i = "island like '%" + cmbisland.Text + "%'"
End If

If chk(1).Value = 1 Then
If i <> "" Then
i = i & " and " & trans
ElseIf trans <> "" Then
i = act1 & " and " & trans
Else
i = trans
End If
End If
If chk(2).Value = 1 Then
If i <> "" Then
i = i & " and " & act1
ElseIf i <> "" Then
If trans <> "" Then
i = i & " and " & trans & " and " & act1
End If
Else
i = act1
End If
End If
If chk(3).Value = 1 Then
If i <> "" Then
i = i & " and " & act2
ElseIf i And trans <> "" Then
i = i & " and " & act2 & " and " & trans
ElseIf i <> "" Then
If trans <> "" Then
If act1 <> "" Then
i = i & " and " & act2 & " and " & trans & " and " & act1
End If
End If
Else
i = act2
End If
End If
If chk(4).Value = 1 Then
If i <> "" Then
i = i & " and " & chus
ElseIf i And trans <> "" Then
i = i & " and " & chus & " and " & trans
ElseIf i <> "" Then
If trans <> "" Then
If act1 <> "" Then
i = i & " and " & chus & " and " & trans & " and " & act1
End If
End If
ElseIf i <> "" Then
If trans <> "" Then
If act1 <> "" Then
If act2 <> "" Then
i = i & " and " & chus & " and " & trans & " and " & act1 & " and " & act2
End If
End If
End If
Else
i = chus
End If
End If
If chk(5).Value = 1 Then
If i <> "" Then
i = i & " and " & loc
ElseIf i And trans <> "" Then
i = i & " and " & loc & " and " & trans
ElseIf i And trans <> "" Then
If act1 <> "" Then
i = i & " and " & loc & " and " & trans & " and " & act1
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
i = i & " and " & loc & " and " & trans & " and " & act1 & " and " & chus
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If act2 <> "" Then
i = i & " and " & loc & " and " & trans & " and " & act1 & " and " & chus & " and " & act2
End If
End If
End If
Else
i = loc
End If
End If
If chk(6).Value = 1 Then
If i <> "" Then
i = i & " and " & los
ElseIf i And trans <> "" Then
i = i & " and " & los & " and " & trans
ElseIf i And trans <> "" Then
If act1 <> "" Then
i = i & " and " & los & " and " & trans & " and " & act1
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
i = i & " and " & los & " and " & trans & " and " & act1 & " and " & chus
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
i = i & " and " & los & " and " & trans & " and " & act1 & " and " & chus & " and " & loc
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
i = i & " and " & los & " and " & trans & " and " & act1 & " and " & chus & " and " & loc & " and " & act2
End If
End If
End If
End If
Else
i = los
End If
End If
If chk(6).Value = 1 Then
If i <> "" Then
i = i & " and " & los1
ElseIf i And trans <> "" Then
i = i & " and " & los1 & " and " & trans
ElseIf i And trans <> "" Then
If act1 <> "" Then
i = i & " and " & los1 & " and " & trans & " and " & act1
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & los1 & " and " & chus
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & los1 & " and " & chus & " and " & loc
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & los1 & " and " & chus & " and " & loc & " and " & act2
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & los1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los
End If
End If
End If
End If
End If
Else
i = los1
End If
End If
If chk(7).Value = 1 Then
If i <> "" Then
i = i & " and " & bud1
ElseIf i And trans <> "" Then
i = i & " and " & bud1 & " and " & trans
ElseIf i And trans <> "" Then
If act1 <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1 & " and " & chus
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1 & " and " & chus & " and " & loc
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1 & " and " & chus & " and " & loc & " and " & act2
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los
End If
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
If los1 <> "" Then
i = i & " and " & bud1 & " and " & trans & " and " & act1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los & " and " & los1
End If
End If
End If
End If
End If
End If
Else
i = bud1
End If
End If
If chk(7).Value = 1 Then
If i <> "" Then
i = i & " and " & bud2
ElseIf i And trans <> "" Then
i = i & " and " & bud2 & " and " & trans
ElseIf i And trans <> "" Then
If act1 <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus & " and " & loc
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus & " and " & loc & " and " & act2
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los
End If
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
If los1 <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los & " and " & los1
End If
End If
End If
End If
End If
End If
ElseIf i And trans <> "" Then
If act1 <> "" Then
If chus <> "" Then
If loc <> "" Then
If act2 <> "" Then
If los <> "" Then
If los1 <> "" Then
If bud1 <> "" Then
i = i & " and " & trans & " and " & chus & " and " & act1 & " and " & chus & " and " & loc & " and " & act2 & " and " & los & " and " & los1 & " and " & bud1
End If
End If
End If
End If
End If
End If
End If
Else
i = bud2
End If
End If

Text1.Text = i

If chk(0) = False And chk(1) = False And chk(2) = False And chk(3) = False And chk(4) = False And chk(5) = False And chk(6) = False Then
MsgBox "NO!NO!NO! Akala mo ha?"
MsgBox "ANO KA BA??PUMILI ka Muna!OK!"
Else
rssearch.Filter = i
If rssearch.BOF = True Then
MsgBox ("Sorry,No PLACE(s) fOund!")
End
Do
Frm_2.listresult.AddItem rssearch.Fields("lugar")
rssearch.MoveNext
Loop While Not rssearch.EOF
End If
End If
MsgBox Frm_1.txtname & " " & listresult.ListCount & " Place(s) Found!"
'Frm_2.Hide
'Frm_3.Show

End Sub

Public Sub commandreset_Click()
Frm_ask.Show
Frm_2.Hide
End Sub

Sign In or Register to comment.