Hi Ranman256. Thanks for reply.usu the listbox is for picking 1 item. which gets highlighted.
one can also set it to pick many items which also get highlighted.
why would you mess it up by throwing in MORE colors to distract from the selected one?
Hi MajP. Thanks for reply.You can build a subform that functions as a listbox and then format it any way you like. Format fonts and colors.
A listview control can do this, but those are hard to program.
I doubt you have the skill set to modify Leban's code. How versed are you in complex windows API? We already provided a working solution to show how to modify a standarard subform to work like a listbox. Provides everything asked for and more.perhaps I can adapt the Lebans example
Hi MajP.It may require a little bit of code as I have demonstrated, but bottom line there is nothing IMO you can do with a listbox you cannot do with a subform.
Thanks for link. I found many helpful information since I'm new in Access.See my discussion on Events and how you can make a single function that reacts to any double click event.
What You Need to Know About Access Events
There is often a lot of confusion about Access Events and often answering questions posed here is difficult because of inaccurate terminology. People often say "Event" when it is unclear if they mean the actual event that takes place, the event procedure, or the event property. This thread...www.access-programmers.co.uk
Private Sub txtHighLight_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fRequest"
stLinkCriteria = "RequestID= " & CurrentID
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, , , FormArg
End Sub
Private Sub Form_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fRequest"
stLinkCriteria = "RequestID= " & CurrentID
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, , , FormArg
End Sub
Thanks a lot. Works exactly like I expected. Now I will looking for how create search function for that.I made a function
Then in any control I can add in the doubleclick eventCode:Public Function OpenForm() 'in a controls double click event add =OpenForm DoCmd.OpenForm "Employees", , , "EmployeeID = " & Me.EmployeeID End Function
=OpenForm()
Hi MajP.I made a function
Then in any control I can add in the doubleclick eventCode:Public Function OpenForm() 'in a controls double click event add =OpenForm DoCmd.OpenForm "Employees", , , "EmployeeID = " & Me.EmployeeID End Function
=OpenForm()
Public Function OpenForm()
'those 2 line I added to create title for child form
Dim formArg As Variant
formArg = Me.SupplyID + "," + Me.Supply
'in a controls double click event add =OpenForm
DoCmd.OpenForm "fSupply", , , "SupplyID = " & Me.SupplyID, , , formArg
End Function
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
Dim formArg() As Variant
formArg = Split(Form.OpenArgs, ",")
Me.Caption = formArg(1)
End Sub