Listbox Value

Lourry

Registered User.
Local time
Today, 06:56
Joined
May 19, 2004
Messages
41
Hi,

I'm sorry if this has been posted earlier but I can't seem to find any post that I totally understand as I am new to Access.

I have a listbox which stores status of a project. In the listbox, the values are:

Requested
In-Progress
Cancelled
Completed

In a UI that my co-worker created, if a user chose "Requested" it will store the value "0" in the table, or if the user chose "In-Progress" it will store the value "1" in the table. So the table column that relate to this field are all 0,1,2,3 values. I have created a listbox in Access and filled the RowSource with "Requested";"In-Progress";"Cancelled";"Completed". When I bound the listbox to the table field, it only shows up as 0s, 1s, 2s, 3s instead of showing the actual words like "Requested", "In-Progess"...etc.
How can I make the listbox to show "Requested" when the value in the table is 0 and so forth??

Thanks in advance!!
-Lory
 
I'm sorry, let me rephrase my question........

I have a database table in Oracle and I am creating a form in Access to basically read the information and perhaps add new records. In the Oracle table, there is a field called Status and it stores the index number of the selected value of a listbox.

For example:

Project Status
1 0
2 3
3 1
4 2
. .
. .


I created a listbox called lstStatus on a form and bound the listbox to the Status field in the Oracle table. When I go through the records using the form, say starting at the beginning of the dtabase. The listbox will have no reaction (Nothing is selected)
I have entered the values in the listbox in the following order "Requested";"In-Progress";"Cancelled";"Completed" and it is showing up properly.

My question is.....is there a way to code the listbox so that if it gets a "0" from the Oracle table then it will refer to the value that has a listIndex of 0 which is "Requested" and highlight "Requested" in the listbox??

Example:
For the first record: on the form, the listbox will have "Requested" highlighted, the second record will have "Completed" highlighted...etc

Please help as I am really desparate!
Thanks again for everyone that is reading this post.
-Lory
 
Your listbox should have '2' columns and the bound column as '2'. The column widths should be 3cm;0 so that only first column is visible and the list data should read
"Requested";0;"In-Progress";1;"Cancelled";2;......etc
That is, if you say there are 2 columns then the list must be in pairs.
If you bind the listbox control source to the field in your query/table it should work.
But it's early monday morning so who knows!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom