473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help me about Filter

hi all....

i have good experience with vb
but i have some serious problems
i have created a mysql with table dss
but i`m confused about this
i think many people will have this problem in future
this is the table of dss
==================
date (data type = date)
drivers(data type = text)
group (data type = text)
speed(data type = number)
score (data type =number)
==================

-----------------------------------------------------------------
Date | Drivers | Group | Speed | Score |
-----------------------------------------------------------------
01/01/2006 2111 north 64 98
02/01/2006 2121 north 53 95
03/01/2006 2145 north 43 96
04/01/2006 2187 south 77 94
05/01/2006 2133 north 35 92
06/01/2006 2165 south 38 100
07/01/2006 2181 north 38 80
08/01/2006 2135 north 42 60
09/01/2006 2111 north 43 44
10/01/2006 2124 south 41 85
11/01/2006 2113 north 45 82
12/01/2006 2109 north 75 96
13/01/2006 2106 north 75 99
14/01/2006 2111 north 75 87
15/01/2006 2123 south 90 56
--------------------------------------------------------
then i want select the date from 01/01/2006 until 10/01/2006 with
the driver is 2111 with group north and with speed from 24 until 90
with score from 50 until 100 and show it into datagrid
but i can selected any in checkbox and unselected to show what field i
just wanna filtered
i made date with dtpicker and drivers,group speed and score with
textbox
then i made selected field that i want to filtered with checkbox
this is the details
==================================
check1.value for date
check2.value for drivers
check3.value for group
check4.value for speed
check5.value for score
==================================
date1 = dtpicker1.value
date2 = dtpicker2.value
drivers = txtdrivers.text
group = cbogroups.text (combo box)
speed = txtspeed1.text and txtspeed2.text
score = txtscore1.text and txtscore2.text
==================================
this is a link the picture of the forms
http://www.geocities.com/joanleonz/forms.GIF
i has been wite some code...(still error )
but i want with checkbox like the forms on
http://www.geocities.com/joanleonz/forms.GIF
so i can pick up what field that i want to be filtered
this is the code
---------------------------------------------------------------------------*------

Private Sub Form_Load()
con.ConnectionString = _
"PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=" & App.Path & "\database.mdb;"
con.Open
Set rssppd = New Recordset
rssppd.ActiveConnection = con
rssppd.CursorType = adOpenStatic
rssppd.CursorLocation = adUseClient
rssppd.LockType = adLockOptimistic
rssppd.Open "select * from dss"
Set DataGrid1.DataSource = rssppd
End Sub
---------------------------------------------------------------------------*---

Private Sub cmdfilter_Click()
Set rssppd = New Recordset
rssppd.ActiveConnection = con
rssppd.CursorType = adOpenStatic
rssppd.CursorLocation = adUseClient
rssppd.LockType = adLockOptimistic
strsql = "select * from dss where date between date >='" &
(dtpicker1.Text) & "'" & _
"and date <='" & (dtpicker2.Text) & "'" & " and drivers='" &
txtdrivers.Text & "'" & _
"and groups='" & cbogroups.Text & "'" & _
"and speed>='" & txtspeed1.Text & "'" & _
"and speed>='" & txtspeed2.Text & "'" & _
"and score>='" & txtscore1.Text & "'" & _
"and score>='" & txtscore2.Text & "'"
rssppd.Open strsql, con, adOpenStatic, adLockBatchOptimistic
end sub
please help me what kind of code what must i have
please help me? URGENT!
thanks

Jun 17 '06 #1
1 1253
You are using the >= operator for both speed values and both score
values. One of each should use the <= operator.

do**********@gmail.com wrote:
hi all....

i have good experience with vb
but i have some serious problems
i have created a mysql with table dss
but i`m confused about this
i think many people will have this problem in future
this is the table of dss
==================
date (data type = date)
drivers(data type = text)
group (data type = text)
speed(data type = number)
score (data type =number)
==================

-----------------------------------------------------------------
Date | Drivers | Group | Speed | Score |
-----------------------------------------------------------------
01/01/2006 2111 north 64 98
02/01/2006 2121 north 53 95
03/01/2006 2145 north 43 96
04/01/2006 2187 south 77 94
05/01/2006 2133 north 35 92
06/01/2006 2165 south 38 100
07/01/2006 2181 north 38 80
08/01/2006 2135 north 42 60
09/01/2006 2111 north 43 44
10/01/2006 2124 south 41 85
11/01/2006 2113 north 45 82
12/01/2006 2109 north 75 96
13/01/2006 2106 north 75 99
14/01/2006 2111 north 75 87
15/01/2006 2123 south 90 56
--------------------------------------------------------
then i want select the date from 01/01/2006 until 10/01/2006 with
the driver is 2111 with group north and with speed from 24 until 90
with score from 50 until 100 and show it into datagrid
but i can selected any in checkbox and unselected to show what field i
just wanna filtered
i made date with dtpicker and drivers,group speed and score with
textbox
then i made selected field that i want to filtered with checkbox
this is the details
==================================
check1.value for date
check2.value for drivers
check3.value for group
check4.value for speed
check5.value for score
==================================
date1 = dtpicker1.value
date2 = dtpicker2.value
drivers = txtdrivers.text
group = cbogroups.text (combo box)
speed = txtspeed1.text and txtspeed2.text
score = txtscore1.text and txtscore2.text
==================================
this is a link the picture of the forms
http://www.geocities.com/joanleonz/forms.GIF
i has been wite some code...(still error )
but i want with checkbox like the forms on
http://www.geocities.com/joanleonz/forms.GIF
so i can pick up what field that i want to be filtered
this is the code
---------------------------------------------------------------------------*------

Private Sub Form_Load()
con.ConnectionString = _
"PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=" & App.Path & "\database.mdb;"
con.Open
Set rssppd = New Recordset
rssppd.ActiveConnection = con
rssppd.CursorType = adOpenStatic
rssppd.CursorLocation = adUseClient
rssppd.LockType = adLockOptimistic
rssppd.Open "select * from dss"
Set DataGrid1.DataSource = rssppd
End Sub
---------------------------------------------------------------------------*---

Private Sub cmdfilter_Click()
Set rssppd = New Recordset
rssppd.ActiveConnection = con
rssppd.CursorType = adOpenStatic
rssppd.CursorLocation = adUseClient
rssppd.LockType = adLockOptimistic
strsql = "select * from dss where date between date >='" &
(dtpicker1.Text) & "'" & _
"and date <='" & (dtpicker2.Text) & "'" & " and drivers='" &
txtdrivers.Text & "'" & _
"and groups='" & cbogroups.Text & "'" & _
"and speed>='" & txtspeed1.Text & "'" & _
"and speed>='" & txtspeed2.Text & "'" & _
"and score>='" & txtscore1.Text & "'" & _
"and score>='" & txtscore2.Text & "'"
rssppd.Open strsql, con, adOpenStatic, adLockBatchOptimistic
end sub
please help me what kind of code what must i have
please help me? URGENT!
thanks

Jun 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: NRGY | last post by:
Hi. I need help with a filtering function that I can't get to whatever I try. I have this output that I need to filter: <tr> <td class="box_content" align="center">3,259</td> <td...
5
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've converted an ACC97 .mdb file to an ACC2K2 .adp. A report that worked in ACC97 doesn't work in ACC2K2. Report setup: ACC97 ...
1
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases...
1
by: Julia | last post by:
Hello there. I have a question somewhat related to this topic, and I don't know where else to go. I hope somebody can help. I've created a database in access, that I'd like to share with less...
5
by: chris.withers | last post by:
Hi all, I'm attempting to do something like the following SQL query: SELECT * FROM `users` WHERE idusers != 3 | 2; such as: = "idusers <> 3OR 2";
3
by: sunbeam | last post by:
Short Description of the Project: we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: Wook | last post by:
Ok I got a set of Forms Reports etc it goes like this Reports Form Passes a Filter to the report for the needed results The filter it passes along is fine except one problem I need a way for the...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
5
by: Thelma Roslyn Lubkin | last post by:
I am still having trouble trying to use a popup form to allow user to set filters for the main form. The main form is based on a single table. The popup contains 5 listboxes, so the user can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.