Private Sub Getim()
Dim fromdate As String
Dim fromday, today As Date
If cbSearchAll.Checked Then
objDS.Clear()
objDS = objUser.Search_tblUser("Select * from tbl_ITEM ")
dgimsearch.DataSource = objDS.Tables(0)
ElseIf cboisearchFD.Text = "" Then
If txtItemDesc.Text = "" Then
desc = ""
Else
desc = "or Item_Desc LIKE '%" & txtItemDesc.Text & "%'"
End If
objDS.Clear()
objDS = objUser.Search_tblUser("Select * from tbl_ITEM where Item_No = '" & txtItemNo.Text & "' or Item_Type = '" & cboItemType.Text & "' or Item_Amount " & cboitemAmount.Text & " or Item_Desc LIKE '%" & txtItemDesc.Text & "%'")
Try
If objDS.Tables(0).Rows.Count <= 0 Then
MsgBox("Record Not Found")
Else
dgimsearch.DataSource = objDS.Tables(0)
End If
Catch ex As Exception
End Try
Else
fromday = cboisearchFD.Text & "/" & cboisearchFM.Text & "/" & cboisearchFY.Text
today = cboisearchTD.Text & "/" & cboisearchTM.Text & "/" & cboisearchTY.Text
objDS.Clear()
objDS = objUser.Search_tblUser("Select * from tbl_ITEM where Expire_Day Between #" & fromday & "# and #" & today & "#")
Try
If objDS.Tables(0).Rows.Count <= 0 Then
MsgBox("Record Not Found")
Else
dgimsearch.DataSource = objDS.Tables(0)
End If
Catch ex As Exception
End Try
End If
End Sub