Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 18th, 2005, 02:22 PM
sopedaddy sopedaddy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 sopedaddy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Filter for Query using text box, option group, and cmd button.

I have a form(frmMainWorkflow) that I use to create, edit, or view records. I also have a form(frmMenuStart) that calls to frmMainWorkflow in a couple of different ways. The condition I'm working on now is a search function that uses a text box that has the search criteria and three option buttons in a group(open, closed, all). I need to filter the query for frmMainWorkflow by using these options. The qryMainWorkflow uses two tables tblMainWorkflow and tblEDMOlist, each record has a check box called IsClosed to mark the record if it is closed. Can someone point me to, or give me, a good example of using option groups in this type of situation?

Sopedaddy

Last edited by sopedaddy : January 18th, 2005 at 02:32 PM. Reason: more detail

Reply With Quote
  #2  
Old January 18th, 2005, 05:34 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Sopedaddy,

One of the problems using an option group(open, closed, all) is that each button will require a value which can be a negative, zero or a positive value but not Null. However a check box has only two values -1 (Yes) and 0 (No). Which means you can set the open, closed buttons to those values, but to retrieve all the records the option group will have to have a Null. You can use the IIf statement to simulate a Null and then work that into your query for the criteria.

A typical SQL of a query using this example would look something like this:

SELECT TableName.*
FROM TableName
WHERE (((IIf([Forms]![FormName]![OptionGroupName]=-1 Or [Forms]![FormName]![OptionGroupName]=0,[Forms]![FormName]![OptionGroupName])) Is Null)) OR (((TableName.CheckBoxName)=IIf([Forms]![FormName]![OptionGroupName]=-1 Or [Forms]![FormName]![OptionGroupName]=0,[Forms]![FormName]![OptionGroupName])));

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Filter for Query using text box and option group


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT