List Box - Query As Row Source

G

Guest

I have a list box, which for the row source, I'm using a query. The reason
is I'm going to code it so when I click on any line of data in the list box,
it puts that info in the text boxes above (unbound).

Now, lets say the current record in the form has two records in the table
that is being used in the query (the list box row source).

If I go and edit the query with this information, it shows the two records
in the list box. But if I go to another record, these two records in the
list box never change nor go away, even if I go to a record in the main form
that has some records that should show up. I have tried requeries in the
event boxes & coding. Not sure what to do?

List Box Query:

SELECT CallNotesQuery.Indicator, CallNotesQuery.Department,
CallNotesQuery.Subject, CallNotesQuery.Date, CallNotesQuery.Time
FROM CallNotesQuery
WHERE (((CallNotesQuery.CustomerID)=[Forms]![All]![CustomerID]))
ORDER BY CallNotesQuery.Date DESC;


Thanks
Curtis
 
A

Arvin Meyer [MVP]

A bit of code as an [Event Procedure] in the Current event should work:

Sub Form_Current()
Me.lstListBoxName.Requery
End Sub
 

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

Top