?
Solved

Yes No Field

Posted on 2011-03-01
8
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35014107
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35014112
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
ID: 35014186
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:pdvsa
ID: 35014190
screenprintYN
0
 

Author Comment

by:pdvsa
ID: 35014196
oops...it did not save....disregard that screen print.
0
 

Author Comment

by:pdvsa
ID: 35014202
here it is...
untitled.JPG
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 35014217
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
ID: 35014247
beautiful....that worked.  thanks again...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

777 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