Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Apply filter to a form

Posted on 2007-10-20
15
Medium Priority
?
225 Views
Last Modified: 2010-04-23
I want to open a form and filter the records only to shows the records where Me.CheckCheckbox = False
0
Comment
Question by:wiswalld
  • 6
  • 5
  • 4
15 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 20114878
What king of record in what object (datagridview, listview, ...) ?

If you retrieve information from an database you can use something like "SELECT * FROM myTable WHERE active = " & Me.CheckBox1.Ckecked

Can you tell us more ?

jpaulino
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 20114884
... being a master in access databases you should know that! :-)

Post more information.
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20114893
In the query designed in VB.Net I tried this but I keep getting errors. If I take away the where part it works.

SELECT     AutoNumber, [Check], [Date], [Time], BOLO
FROM         message
WHERE     ([Check] = [false])


I cannot figure out this VB
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Author Comment

by:wiswalld
ID: 20114896
So I was figuring on just adding a filter to the binding source.
0
 
LVL 8

Expert Comment

by:MrRobot
ID: 20114927
=)

right, access, probably...
probably where something in some records equals to some checkbox value on the form or something... I have a great 6th sense! =)

wiswalld:

"....... where myField = " & Me.CheckCheckbox = False



0
 
LVL 48

Expert Comment

by:jpaulino
ID: 20114933
You can get the information from the SQL directly, like the example I post already.

Show us more code ...
0
 
LVL 8

Accepted Solution

by:
MrRobot earned 500 total points
ID: 20114943
ah.. it's an sql query on vb.net

WHERE     ([Check] = [false])

won't work,

sql uses 1 / 0 instead of true / false. so you try

[check] = 0

please try to give more info when asking a question, this will help you get faster replies.

0
 
LVL 8

Expert Comment

by:MrRobot
ID: 20114989
so you can use

"SELECT     AutoNumber, [Check], [Date], [Time], BOLO FROM         message WHERE     ([Check] = " & Math.Abs(CInt(chkMyBox.Checked)) & ")"

0
 
LVL 13

Author Comment

by:wiswalld
ID: 20115001
That did it. Thanks.


JPaulino maybe I should stick to access. I hate trying to learn new things :-)

0
 
LVL 8

Expert Comment

by:MrRobot
ID: 20115014
or

"SELECT AutoNumber, [Check], [Date], [Time], BOLO FROM message WHERE [Check] = " & IIf(chkMyBox.Checked, "1", "0")
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20115028
Thank. I can't believe I couldn't figure that out.

Dave
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 20115101
wiswalld,

I do all my project (VB or ASP) in SQL. I don't use access anymore. Just for small things.

You didn't told us if you use SQL, Access, MySql, etc. I just asked for more information.

Good luck
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20115111
Sorry.


Note to self (explain more)
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 20115113
>> I hate trying to learn new things

You must always learn new thing if you really like development!

I love to learn and SQL is very used in the industry.
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20115114
Don't try to confuse me. I am just learning with access. SQL will only screw me up.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question