473,509 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yes/No boxes show -1 and 0

rcollins
234 New Member
When I made my list box (selector to find client data) my yes and no values show -1 and 0 not yes and no. Am I missing something?
Dec 4 '07 #1
5 1801
FishVal
2,653 Recognized Expert Specialist
Hi, Collins.

-1 and 0 are actually the values stored in database representing boolean values True and False respectively (or Yes and No as you like).
I would like to suggest you to replace that Y/N field in your query - RowSource for your ListBox, with a computation based on that field.

Something like this.
Expand|Select|Wrap|Line Numbers
  1. SELECT ......, IIf(blnYesNoField, 'Yes', 'No') AS txtYesNoField FROM ....
  2.  
Regards,
Fish
Dec 4 '07 #2
rcollins
234 New Member
Hi, Collins.

-1 and 0 are actually the values stored in database representing boolean values True and False respectively (or Yes and No as you like).
I would like to suggest you to replace that Y/N field in your query - RowSource for your ListBox, with a computation based on that field.

Something like this.
Expand|Select|Wrap|Line Numbers
  1. SELECT ......, IIf(blnYesNoField, 'Yes', 'No') AS txtYesNoField FROM ....
  2.  
Regards,
Fish
Right now I have the RowSource set as qryActive where it pulls the Client name, Active and Employment consultant. I guess I am not sure where to add this
Expand|Select|Wrap|Line Numbers
  1. SELECT tblClient.ID AS tblClient_ID, tblClient.LastName AS tblClient_LastName, tblClient.FirstName AS tblClient_FirstName, tblClient.Active, tblStaff.ID AS tblStaff_ID, tblStaff.LastName AS tblStaff_LastName, tblStaff.FirstName AS tblStaff_FirstName, tblClient.EmploymentConsultant
  2. FROM tblStaff INNER JOIN tblClient ON tblStaff.ID=tblClient.EmploymentConsultant
  3. WHERE (((tblClient.Active)=True))
  4. ORDER BY tblClient.LastName;
  5.  
Dec 4 '07 #3
FishVal
2,653 Recognized Expert Specialist
Right now I have the RowSource set as qryActive where it pulls the Client name, Active and Employment consultant. I guess I am not sure where to add this
Expand|Select|Wrap|Line Numbers
  1. SELECT tblClient.ID AS tblClient_ID, tblClient.LastName AS tblClient_LastName, tblClient.FirstName AS tblClient_FirstName, tblClient.Active, tblStaff.ID AS tblStaff_ID, tblStaff.LastName AS tblStaff_LastName, tblStaff.FirstName AS tblStaff_FirstName, tblClient.EmploymentConsultant
  2. FROM tblStaff INNER JOIN tblClient ON tblStaff.ID=tblClient.EmploymentConsultant
  3. WHERE (((tblClient.Active)=True))
  4. ORDER BY tblClient.LastName;
  5.  
Ok.

I guess the field mentioned is tblClient.Active.
So make the following changes to the query.

Expand|Select|Wrap|Line Numbers
  1. SELECT tblClient.ID AS tblClient_ID, tblClient.LastName AS tblClient_LastName, tblClient.FirstName AS tblClient_FirstName,
  2. IIf(tblClient.Active, 'Yes', 'No') AS txtIsClientActive,
  3. tblStaff.ID AS tblStaff_ID, tblStaff.LastName AS tblStaff_LastName, tblStaff.FirstName AS tblStaff_FirstName, tblClient.EmploymentConsultant
  4. FROM tblStaff INNER JOIN tblClient ON tblStaff.ID=tblClient.EmploymentConsultant
  5. WHERE (((tblClient.Active)=True))
  6. ORDER BY tblClient.LastName;
  7.  
Though right now i don't see what you are trying to represent in your listbox as long as all fetched records will have tblClient.Active=True.
Dec 4 '07 #4
rcollins
234 New Member
Though right now i don't see what you are trying to represent in your listbox as long as all fetched records will have tblClient.Active=True.[/quote]

That worked great. Thank you. I need the data people to be able to see who is active and who is not. They have a checkbox that limits to active or expands to all. Yes and No work better than -1 and 0.
Dec 4 '07 #5
FishVal
2,653 Recognized Expert Specialist
You are welcome.

Best regards,
Fish
Dec 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3714
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command...
19
6855
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
2
8909
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
3
2844
by: Jim Irvine | last post by:
I have a small database made up of 2 tables. I have a report that is driven from a query. On the report are a couple of fields linked to memo boxes in the table. Everytime I run the report I get...
7
3085
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
7
4499
by: ljungers | last post by:
Have Form-1 with 3 text boxes and 1 command button. With any of the 3 boxes filled out and button is clicked, a Macro is performed that Opens a Query that has a WHERE clause that uses the 3 test...
2
4490
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
6
12172
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
I have an app that displays about 20 items of data in text boxes. Very occasionally I need to allow these to be used for data entry, but the bulk of the time they are solely for information. They...
4
1906
by: ckpoll2 | last post by:
Ok, so I'm wondering if what I need to do is even possible because I haven't been able to figure out how to do it and I haven't seen any similar posts on here. In a table, I have a series of...
12
2133
by: Lnwolf | last post by:
Hello, I am having an issue with my synchronized combo boxes and don't know how to fix it. I have created two boxes and have made the synchronization work (the user clicks on the first box and...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.