473,385 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Listbox displaying 0 and -1 instead of Yes/No

I'm using A2003 connected to a SQL 2000 backend. This is not an adp.
I have a table which I store 0 and -1 for 2 bit fields. I have a
listbox on a form based on a query of this table. The listbox is
supposed to display Yes or No and has sucessfully for the last 2
years. Today the user noticed that it's now displaying 0's and -1's.
If I run the query, the query displays Yes or No. Any idea on what is
happening here?

Thanks for any help or advice.
Jun 27 '08 #1
7 5399
On Apr 21, 10:10*am, EManning <manning_n...@hotmail.comwrote:
I'm using A2003 connected to a SQL 2000 backend. *This is not an adp.
I have a table which I store 0 and -1 for 2 bit fields. *I have a
listbox on a form based on a query of this table. *The listbox is
supposed to display Yes or No and has sucessfully for the last 2
years. *Today the user noticed that it's now displaying 0's and -1's.
If I run the query, the query displays Yes or No. Any idea on what is
happening here?

Thanks for any help or advice.
Update - I imported the table so that it is a pure Access table. But
it made no difference to the listbox display.

Jun 27 '08 #2
Hello,

Try this: create a new form and add a new listbox to it and set your
query as the recordsource for the new listbox in the new form and see
what it displays. If this new listbox still displays 1's, 0's then try
the following:

Create a DAO recordset object and set its source to your query. Then
loop through the recordset in debug mode and see what the recordset
displays

Dim RS As DAO.Recordset
Set RS = CurrentDB.OpenRecordset("Select * From yourQuery)
Do While Not RS.EOF
Debug.print RS!YourYesNofield
RS.MoveNext
Loop

If the recordset displays yes and no then the only other thing I could
suggest is to write a function that explicitly returns yes or no. YOu
can set this function in the query in the yes/no field

Public Function Yes_No(i As Integer) As String
If i = 1 Then Yes_No = "Yes"
If i = 0 Then Yes_No = "No"
End Function

Create a new column in your query and set its source like this

NewColumn=Yes_No(theOldColumn)

And now reference this column in the Listbox.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #3
On Apr 21, 1:27*pm, Rich P <rpng...@aol.comwrote:
Hello,

Try this: *create a new form and add a new listbox to it and set your
query as the recordsource for the new listbox in the new form and see
what it displays. *If this new listbox still displays 1's, 0's then try
the following:

Create a DAO recordset object and set its source to your query. *Then
loop through the recordset in debug mode and see what the recordset
displays

Dim RS As DAO.Recordset
Set RS = CurrentDB.OpenRecordset("Select * From yourQuery)
Do While Not RS.EOF
* Debug.print RS!YourYesNofield
* RS.MoveNext
Loop

If the recordset displays yes and no then the only other thing I could
suggest is to write a function that explicitly returns yes or no. *YOu
can set this function in the query in the yes/no field

Public Function Yes_No(i As Integer) As String
* If i = 1 Then Yes_No = "Yes"
* If i = 0 Then Yes_No = "No"
End Function

Create a new column in your query and set its source like this

NewColumn=Yes_No(theOldColumn)

And now reference this column in the Listbox.

Rich

*** Sent via Developersdexhttp://www.developersdex.com***
I used your function idea and that worked great! Thanks for your
reply.

Jun 27 '08 #4
EManning wrote:
On Apr 21, 10:10 am, EManning <manning_n...@hotmail.comwrote:
>>I'm using A2003 connected to a SQL 2000 backend. This is not an adp.
I have a table which I store 0 and -1 for 2 bit fields. I have a
listbox on a form based on a query of this table. The listbox is
supposed to display Yes or No and has sucessfully for the last 2
years. Today the user noticed that it's now displaying 0's and -1's.
If I run the query, the query displays Yes or No. Any idea on what is
happening here?

Thanks for any help or advice.


Update - I imported the table so that it is a pure Access table. But
it made no difference to the listbox display.
It's odd that it didn't work on an Access table. I created a table with
a Yes/No field. I set the Format in the table's Format property field
to Yes/No. I created a form and it displayed Yes/No in the listbox. I
changed the format in the table to True/False and then opened the form
and it displayed True/False. It seems to follow the format I set in the
table.

Free
http://www.youtube.com/watch?v=hoGXKU5XM9I
Jun 27 '08 #5
EManning <ma**********@hotmail.comwrote in
news:bb1c6656-2de1-43db-83e5-79e138da9438
@u36g2000prf.googlegroups.co
m:
On Apr 21, 10:10*am, EManning <manning_n...@hotmail.comwrote:
>I'm using A2003 connected to a SQL 2000 backend. *This is not an
adp. I have a table which I store 0 and -1 for 2 bit fields. *I
have a listbox on a form based on a query of this table. *The
listbox is supposed to display Yes or No and has sucessfully for
the last 2 years. *Today the user noticed that it's now
displaying 0's and -1's. If I run the query, the query displays
Yes or No. Any idea on what is happening here?

Thanks for any help or advice.

Update - I imported the table so that it is a pure Access table.
But it made no difference to the listbox display.
MS Office Service Pack 3 is the culprit.
http://support.microsoft.com/kb/945674

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Jun 27 '08 #6
On Apr 21, 4:00*pm, Salad <o...@vinegar.comwrote:
EManning wrote:
On Apr 21, 10:10 am, EManning <manning_n...@hotmail.comwrote:
>I'm using A2003 connected to a SQL 2000 backend. *This is not an adp.
I have a table which I store 0 and -1 for 2 bit fields. *I have a
listbox on a form based on a query of this table. *The listbox is
supposed to display Yes or No and has sucessfully for the last 2
years. *Today the user noticed that it's now displaying 0's and -1's.
If I run the query, the query displays Yes or No. Any idea on what is
happening here?
>Thanks for any help or advice.
Update - I imported the table so that it is a pure Access table. *But
it made no difference to the listbox display.

It's odd that it didn't work on an Access table. *I created a table with
a Yes/No field. *I set the Format in the table's Format property field
to Yes/No. *I created a form and it displayed Yes/No in the listbox. *I
changed the format in the table to True/False and then opened the form
and it displayed True/False. *It seems to follow the format I set in the
table.

Freehttp://www.youtube.com/watch?v=hoGXKU5XM9I- Hide quoted text -

- Show quoted text -
I guess in all my years as an Access developer I have never had a yes/
no field in a listbox before because I've never seen this behavior.
But I tried it yesterday in some other databases I've developed and
the listbox always displayed 0's and 1's instead of Yes/No. Now I
have to go back thru all of the db's I've developed and check for this
problem.
Jun 27 '08 #7
On Apr 21, 4:43*pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
EManning <manning_n...@hotmail.comwrote in
news:bb1c6656-2de1-43db-83e5-79e138da9438
@u36g2000prf.googlegroups.co
m:
On Apr 21, 10:10*am, EManning <manning_n...@hotmail.comwrote:
I'm using A2003 connected to a SQL 2000 backend. *This is not an
adp. I have a table which I store 0 and -1 for 2 bit fields. *I
have a listbox on a form based on a query of this table. *The
listbox is supposed to display Yes or No and has sucessfully for
the last 2 years. *Today the user noticed that it's now
displaying 0's and -1's. If I run the query, the query displays
Yes or No. Any idea on what is happening here?
Thanks for any help or advice.
Update - I imported the table so that it is a pure Access table.
But it made no difference to the listbox display.

MS Office Service Pack 3 is the culprit.http://support.microsoft.com/kb/945674

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Thanks for your reply. I'll check this out.
Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve Edwards | last post by:
I have a database that is used for tracking customer survey data. Each customer can have multiple products. I have a report that lists customers that have not yet been surveyed...
1
by: Annette Massie | last post by:
I would like to have a form that lists current addresses being used. On this form I would also like to have a command button that would allow the user to add an address if they do not see it...
6
by: Janaka | last post by:
Help! I have two ListBox controls on my web form. The first one gets populated on entry with values from the DB. I then use JavaScript to copy options from this ListBox to my second one. (I...
3
by: Patrick Sullivan | last post by:
I am trying to read a text file laid out like, "textfield1, textfield2, etc," and only extract the first value (textfield1) to add to the listbox. But instead of listing vertically, I get three...
14
by: Paul_Madden via DotNetMonster.com | last post by:
Basically I have a listbox to which I add simple STRING items- I have a progress bar which I increment whenever I populate another portion of the complete set of items I wish to add. What I observe...
3
by: superjacent | last post by:
Hope someone can help. I have a listbox displaying time periods in blocks of 15 mins for a 24 hour period, all up 96 rows. The listbox can only visibly show 20 rows a time. The default...
6
by: Pippen | last post by:
Hi, I'm trying to read all the selected items in a ListBox. So after the user selects the values they want in the ListBox they select a button. This is where I want to put into a string all the...
1
by: johnVarma | last post by:
Hi All, Iam facing a problem with bar chart using coldFusion. if there is only one <cfchartseries> tag then the seriesLabel attribute is not displaying instead of that the items of the...
1
by: Kunal101 | last post by:
Hi, I hav a web service which pull records from a database and I am hosting these services in IIS which works fine but I am trying to retrieve the record and display the record in a listbox...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.