Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Listbox question.

Status
Not open for further replies.

Eightball3

Programmer
Nov 23, 2002
138
US
How do you move the focus not select, move the thin dotted line around the item in the listbox?
 
Thanks for the reply.

I don't want to select the item in the listbox (the entire row would be black if selected). I want it to have the fine dotted line bordering the item (like what you would get if you use the arrow keys on a listbox).

Thanks
 
It does exactly what you want, I've just checked
TIA
 
TLady, believe me I have :)

This is my code.

Dim ctrl As Control
Dim x As Integer
Dim y As Integer

If List0.ItemsSelected.Count > 0 Then
Set ctrl = [List0]
y = List0.ListCount
For x = 0 To y - 1
List0.SetFocus
If List0.Selected(x) = True Then
Me![Activity] = ctrl.Column(1, x)
Me![POC] = ctrl.Column(0, x)
DoCmd.OpenForm "poc form", acNormal, , , acFormEdit, acIcon
Forms![poc_form].RecordSource = "Recall2"
If Forms![poc_form]![Recall] = "y" Then
Dim strREPORTNAME As String
Dim strTEMPFILENAME As String
strREPORTNAME = "Recall"
strTEMPFILENAME = "C:\apps\Recall.snp"
DoCmd.OutputTo acOutputReport, strREPORTNAME, acFormatSNP, strTEMPFILENAME, False 'don't start OLE app
Call SendMessage_Mail2
Else
DoCmd.OpenReport "Recall", acViewNormal
End If
DoCmd.Close acForm, "poc_form"
List0.Selected(x) = False
End If
Next x
Set ctrl = Nothing
End If

What I'm trying to do is (and it is working) give the user the ability to select items in a listbox. When finished, press a button that will initiate an emailing to each person selected in the listbox. As each item is processed, I want the item to be un-selected. This will give the user a visual affect that things are happening as well as show them where they're at in the emailing process. All of this works great with the above code.

The part that isn't working is that if the item is not in the visible area of the listbox window you won't see the un-selection occur. By simply un-selecting the item it doesn't move to the item in the listbox. As items are processed I want the listbox to scroll allowing the user to see the un-selection take place.

I know this is a bit wordy, but it is difficult to explain.
 
OMGoodness !
Entirely different and all more complicated !
Let's see if we can find out HOW TO ... as I understood what is that you want now.

BTW, can you paste code wich actually will color selected row ? Thanks
TIA
 
Hi TLady,
What I mean't was if the item is selected it is blackened. I really don't know if you can color the selected row other than by selecting different form object colors.
 
Hi,

A bit too complicated for me Eightball3. Well done TLady for having a go.

Don't think it possible to do what you're asking. Take a look at nathan1967.zip, this a list box I did for someone else recently, you can certainly see what's going on. The address is:
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top