Solved

Yes No Field

Posted on 2011-03-01
8
259 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
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 119

Expert Comment

by:Rey Obrero
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
 

Author Comment

by:pdvsa
ID: 35014190
screenprintYN
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 119

Accepted Solution

by:
Rey Obrero earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

20 Experts available now in Live!

Get 1:1 Help Now