Can't select anything from list box

  • Thread starter Thread starter laavista
  • Start date Start date
L

laavista

I’m using Access 2003. I have a list box (called ListRecruiters) in the
detail section of the form. The list box displays the correct values, but
it does not allow anything to be selected.

Row source is: SELECT DISTINCT t_MilitaryBase.Recruiter FROM
t_MilitaryBase UNION select "All" from t_MilitaryBase;

Row Source Type: Table/Query
Bound Column 1
Allow value list edits No (I’ve tried yes)
Inherit value list no
Show only row source value no
Enabled yes
Locked no

The values in the list box are correct so I’m assuming the row source is OK.
When a command button is clicked, I call a procedure. Part of it follows:

Dim strIN As String


Set MyDB = CurrentDb()

strSQL = "SELECT * FROM t_MilitaryBase"

'Build the IN string by looping through the listbox
For i = 0 To ListRecruiters.ListCount - 1
If ListRecruiters.Selected(i) Then
If ListRecruiters.Column(0, i) = "All" Then
flgSelectAll = True
End If
strIN = strIN & "'" & ListRecruiters.Column(0, i) & "',"
End If
Next i

Your help would be greatly appreciated!
 
hi,
I’m using Access 2003. I have a list box (called ListRecruiters) in the
detail section of the form. The list box displays the correct values, but
it does not allow anything to be selected.
So you can't select any value in your ListBox? Or does the CommandButton
not work properly?


mfG
--> stefan <--
 
The command button works.

The list box is populated and the values are not greyed out. I just cannot
select any of them.

Thanks, in advance, for any help you can provide.
 
hi,
The list box is populated and the values are not greyed out. I just cannot
select any of them.
Sounds weird. Create a new form, place a ListBox on it and assign the
RowSource. Does it work? If so, check whether you have set AllowEdit of
your form to true.


mfG
--> stefan <--
 
Back
Top