list box problems

hilbertm

Registered User.
Local time
Today, 00:32
Joined
Sep 7, 2001
Messages
46
I have 2 questions. First, I’m sure there is an easy answer but I have not found it. I would like a list box that is defined by a query, the problem is that the query I want to use is one that the user inputs a value in a dialog box. When the user inputs the value to sort the query, the user has to enter information twice, and the listbox does not always update to the correct data.

The second question is, can I have the user click on an item in a listbox to go to another form that can be filtered by the item clicked in the listbox?

So what I would like is to have the user enter a value in the dialog box, that opens a form that lists the filtered data, then I would like to have a listbox on the form that has records that pertain only to the record that is filtered on the form. Then I would like to have the user click on an item in the listbox to go to another form that has fields that relate to the item clicked on the list.
 
Add an unbound text box to the form containing the list box, put in say the header, use the text box as the criteria instead of the input box, ie. Forms!SomeformName!ControlName, in the after update event of your text box put Me.Requery or the full reference Me.ListName.Requery
 
Rich,
I am confused. where do I put the Forms!SomeformName!ControlName
Is SomeformName = current form that I am using? With the listbox and the unbound text box.
Is ControlName = listbox?
Thanks for your time.
 
OK the Forms!SomeformName!ControlName
goes in the criteria section of the field that contains related data in the underlying query of your list box.
SomeformName is the name of the form that contains the list box and the new unbound text box, controlname is the new unbound text box name.
HTH
 
Rich,
I did all of the above and it is almost working. The list box does not update when the new text box updates. I can get the listbox to update if I go into design mode, then back to regular mode.
 
I am trying to use the new textbox to read data from a field on the form by using the control source ICAO. Which is the same as the input that the user inputs prior to opening the form.
If I type the ICAO in the new textbox the list box updates fine. Is there any way to get the listbox to update without the user inputing the ICAO again?
 
Rich,
I figured it out. Thanks. Is there a way to open a form or record by entering a click event on an item in a listbox?
 
Private Sub lstFound_DblClick(Cancel As Integer)
On Error GoTo Err_lstFound_DblClick

Dim strFormName As String

strFormName = "YouForm"

DoCmd.OpenForm strFormName, , , "[UniqueID] = " & Me!lstFound

DoCmd.Close acForm, Me.Name

Exit_lstFound_DblClick:
Exit Sub

Err_lstFound_DblClick:
MsgBox Err.Description
Resume Exit_lstFound_DblClick

End Sub
 
Rich,
Works like a charm. You have helped me so much that I think you are entitled to at least 1/4 of all proceeds from the this project. Unfortunately this, like all of my projects don't generate any money.
smile.gif

All kidding aside, thanks a lot to you and everyone else that chooses to help. I am learning much more from advice given on this board than I can get from any book.
 

Users who are viewing this thread

Back
Top Bottom