Solved

Yes No Field

Posted on 2011-03-01
8
258 Views
Last Modified: 2012-05-11
Experts,

I have  a true YN field (not text) in the table
I have a filter form with unbound text box (cboExpired)
this textbox is value list with "Yes";"No"
  but this does not work with text.
If I change it from "yes";"No" to -1,0 then it does work.
The user will not understand -1 or 0.  How can I associate -1 to "Yes" and 0 to "No"?

I seem to remember that you can put a sort of alias name in the row source similar to this:
"Yes";(-1);"No";(0)  .....but this is wrong.  
 

Thank you
0
Comment
Question by:pdvsa
  • 5
  • 3
8 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
how, where do you use the cboExpired as filter?

you can use the switch function for this

private sub cboExpired_afterupdate
dim blFilter as boolean

blFilter=iif(cboExpired="yes",-1,0)

me.filter="[YN]=" & blFilter
me.filteron=true
end sub

0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
how, where do you use the cboExpired as filter?

you can use the switch function for this OR

private sub cboExpired_afterupdate
dim blFilter as boolean

blFilter=iif(cboExpired="yes",-1,0)

me.filter="[YN]=" & blFilter
me.filteron=true
end sub

0
 

Author Comment

by:pdvsa
Comment Utility
Cap: I use a form with a few different unbound fields and press report button.  One of those fields is named cboExpired with row source "Yes";"No".  

please see attached.  

I copied the afterupdate code but when I ran the report it said "too complex", which was teh same msg I received when operating as if text.  I dont receive this msg if I place 0 or -1 in the qry under report.

What do you think now?  
0
 

Author Comment

by:pdvsa
Comment Utility
screenprintYN
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:pdvsa
Comment Utility
oops...it did not save....disregard that screen print.
0
 

Author Comment

by:pdvsa
Comment Utility
here it is...
untitled.JPG
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
try using this rowsource

-1;Yes;0;No

and set the following properties
column count 2
bound column 1
column widths 0
0
 

Author Comment

by:pdvsa
Comment Utility
beautiful....that worked.  thanks again...
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now