Unable to select row in listbox

W

wes.tibular

I have a form onto which i placed a listbox. The listbox is correctly
populated from my database, and appears properly displayed.

The problem is that i cannot select an item in that listbox. No
matter where i click, no item is highlighted.

I have Allow Edits= yes on the parent form, as well as Data Entry.
On the listbox itself, Enabled=yes, Locked=no

Yet, Clicking on an item in the listbox does not result in that item
being highlighted, or otherwise indicated as selected.

I am running Access 2003 SP3

What am i missing?

thanks
 
W

wes.tibular

I have a form onto which i placed a listbox.  The listbox is correctly
populated from my database, and appears properly displayed.

The problem is that i cannot select an item in that listbox.  No
matter where i click, no item is highlighted.

I have Allow Edits= yes on the parent form, as well as Data Entry.
On the listbox itself, Enabled=yes, Locked=no

Yet, Clicking on an item in the listbox does not result in that item
being highlighted, or otherwise indicated as selected.

I am running Access 2003 SP3

What am i missing?

thanks

Additional Information: it appears that the listbox does not respond
to OnClick either.
 
K

Ken Snell \(MVP\)

What is the ControlSource of that listbox? My guess is that you've bound it
to a field that cannot be updated.
 
W

wes.tibular

What is the ControlSource of that listbox? My guess is that you've bound it
to a field that cannot be updated.
--

        Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/












- Show quoted text -

ControlSource is the Primary Key of the a table. I can update that
field from teh data view of the table.
So is the answer that i have to populate the listbox with the data
from the table without actually binding it to that data?
 
K

Ken Snell \(MVP\)

What type of field is that primary key field?

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


What is the ControlSource of that listbox? My guess is that you've bound
it
to a field that cannot be updated.
--

Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/












- Show quoted text -

ControlSource is the Primary Key of the a table. I can update that
field from teh data view of the table.
So is the answer that i have to populate the listbox with the data
from the table without actually binding it to that data?
 
W

wes.tibular

What type of field is that primary key field?

--

        Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/







ControlSource is the Primary Key of the a table.  I can update that
field from teh data view of the table.
So is the answer that i have to populate the listbox with the data
from the table without actually binding it to that data?- Hide quoted text -

- Show quoted text -

Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.
 
K

Ken Snell \(MVP\)

Something is not right with that listbox. Is there by chance any invisible
control on top of the list box?

List the values of each property for the list box.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


What type of field is that primary key field?

--

Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/







ControlSource is the Primary Key of the a table. I can update that
field from teh data view of the table.
So is the answer that i have to populate the listbox with the data
from the table without actually binding it to that data?- Hide quoted
text -

- Show quoted text -

Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.
 
W

wes.tibular

Something is not right with that listbox. Is there by chance any invisible
control on top of the list box?

I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around. Nothing on top
of it
List the values of each property for the list box.

Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads: No
Column Widths: <blank>
Bound Column: 1
Default Value: <blank>
IME Hold: No
IME Mode: No Control
IME Sentence Mode: None
Validation Rule: <blank>
Validation Text: <blank>
Status Bar Text: <blank>
Visible: Yes
Display When: Always
Enabled: Yes
Locked: No
Multi Select: None
Tab Stop: Yes
Tab Index: 2
Left: 1.0417"
Top: 0.8333"
Width: 2"
Height: 0.6667"
Back Color: 16777215
Special Effect: Sunken
Border Style: Solid
Border Width: Hairline
Border COlor: 0
Fore Color: 0
Font Name: Tahoma
Font Size: 8
Font Weight: Normal
Font Italic: No
Font Underline: No
Shortcut Menu Bar: <blank>
ControlTip Text: <blank>
Help Context Id: 0
Tag: <blank>
Before Update: <blank>
After Update: <blank>
On Enter: <blank>
On Exit: <blank>
On Got Focus: <blank>
On Click: [Event Procedure]
on Dbl Click: <blank>
On Mouse Down: <blank>
On Mouse Move: <blank>
On Mouse Up: <blank>
On Key Down: <blank>
On Key Up: <blank>
On Key Press: <blank>
Reading Order: Context
Scroll Bar Aligh: Right
Numeral Shapes: System
 
K

Ken Snell \(MVP\)

No Row Source? How are you getting values into the listbox to display?

What is the code that you're running in the Click event?

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Something is not right with that listbox. Is there by chance any invisible
control on top of the list box?

I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around. Nothing on top
of it
List the values of each property for the list box.

Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads: No
Column Widths: <blank>
Bound Column: 1

Enabled: Yes
Locked: No
Multi Select: None

On Click: [Event Procedure]
 
W

wes.tibular

No Row Source? How are you getting values into the listbox to display?

The On Open even for the form runs:


Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT Server.Hostname FROM Server")

Set fld = rst("Hostname")
idx = 0

Do While Not rst.EOF
List12.AddItem Item:=fld, Index:=idx
idx = idx + 1

rst.MoveNext
Loop

The On Click event for the listbox runs:


Label11.Caption = List12.ItemData(List12.ListIndex)

Which is just a test to see the click does the right thing
What is the code that you're running in the Click event?

--

        Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/


Something is not right with that listbox. Is there by chance any invisible
control on top of the list box?

I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around.  Nothing on top
of it


List the values of each property for the list box.

 Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads:  No
Column Widths: <blank>
Bound Column: 1

Enabled: Yes
Locked: No
Multi Select: None

On Click: [Event Procedure]




Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.- Hide
quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
W

wes.tibular

No Row Source? How are you getting values into the listbox to display?

Row source filled in by code in On Open for the form:


Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT Server.Hostname FROM Server")

Set fld = rst("Hostname")
idx = 0

Do While Not rst.EOF
List12.AddItem Item:=fld, Index:=idx
idx = idx + 1

rst.MoveNext
Loop

What is the code that you're running in the Click event?

On Click for the listbox is:


Label11.Caption = List12.ItemData(List12.ListIndex)

basically to ensure that i am selecting something . .

--

        Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/


Something is not right with that listbox. Is there by chance any invisible
control on top of the list box?

I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around.  Nothing on top
of it


List the values of each property for the list box.

 Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads:  No
Column Widths: <blank>
Bound Column: 1

Enabled: Yes
Locked: No
Multi Select: None

On Click: [Event Procedure]




Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.- Hide
quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
K

Ken Snell \(MVP\)

Move the code from the form's Open event to the form's Load event.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


No Row Source? How are you getting values into the listbox to display?

Row source filled in by code in On Open for the form:


Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT Server.Hostname FROM Server")

Set fld = rst("Hostname")
idx = 0

Do While Not rst.EOF
List12.AddItem Item:=fld, Index:=idx
idx = idx + 1

rst.MoveNext
Loop

What is the code that you're running in the Click event?

On Click for the listbox is:


Label11.Caption = List12.ItemData(List12.ListIndex)

basically to ensure that i am selecting something . .

--

Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/


Something is not right with that listbox. Is there by chance any
invisible
control on top of the list box?

I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around. Nothing on top
of it


List the values of each property for the list box.

Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads: No
Column Widths: <blank>
Bound Column: 1

Enabled: Yes
Locked: No
Multi Select: None

On Click: [Event Procedure]




Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.- Hide
quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
W

wes.tibular

Move the code from the form's Open event to the form's Load event.

Not really sure why, but after closing and re-opening the database
application, now scrolling, selection, everything seems to work as
expected.

Ken, thanks very much for all the help you gave me on this.

--

        Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/


No Row Source? How are you getting values into the listbox to display?

Row source filled in by code in On Open for the form:

    Set db = CurrentDb
    Set rst = db.OpenRecordset("SELECT Server.Hostname FROM Server")

    Set fld = rst("Hostname")
    idx = 0

    Do While Not rst.EOF
        List12.AddItem Item:=fld, Index:=idx
        idx = idx + 1

        rst.MoveNext
    Loop


What is the code that you're running in the Click event?

On Click for the listbox is:

    Label11.Caption = List12.ItemData(List12.ListIndex)

basically to ensure that i am selecting something . .




I too thought there was something strange about it, so i created a new
one when i did the alternate population work-around. Nothing on top
of it
Name: List12
Control Source: <blank>
Row Source Type: Value List
Row Source: <blank>
Column Count: 1
Column Heads: No
Column Widths: <blank>
Bound Column: 1
Enabled: Yes
Locked: No
Multi Select: None
On Click: [Event Procedure]
--
Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/
On Nov 28, 8:50 am, "Ken Snell \(MVP\)"
What type of field is that primary key field?
--
Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/
On Nov 28, 7:45 am, "Ken Snell \(MVP\)"
What is the ControlSource of that listbox? My guess is that you've
bound
it
to a field that cannot be updated.
--
Ken Snell
<MS ACCESS MVP>http://www.accessmvp.com/KDSnell/

I have a form onto which i placed a listbox. The listbox is
correctly
populated from my database, and appears properly displayed.
The problem is that i cannot select an item in that listbox. No
matter where i click, no item is highlighted.
I have Allow Edits= yes on the parent form, as well as Data Entry.
On the listbox itself, Enabled=yes, Locked=no
Yet, Clicking on an item in the listbox does not result in that
item
being highlighted, or otherwise indicated as selected.
I am running Access 2003 SP3
What am i missing?
thanks- Hide quoted text -
- Show quoted text -
ControlSource is the Primary Key of the a table. I can update that
field from teh data view of the table.
So is the answer that i have to populate the listbox with the data
from the table without actually binding it to that data?- Hide quoted
text -
- Show quoted text -
Primary key is a text field.
I have created a workaround for this problem. I populated the listbox
with the text values from the table key, as an unbound Value list. I
can select items in the listbox now, but scroling doesn't work.- Hide
quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top