ListBox problem

EndersG

Registered User.
Local time
Today, 08:11
Joined
Feb 18, 2000
Messages
84
I created a ListBox that contains the names of customers who must be sent reminders to renew their magazine subscriptions. This list box is based on an underlying query called ReminderDate that contains the customers' names and the date their renewal notices are to be sent. I placed the function: Date() on the criteria field of the ReminderDate query so that I would know which customers needed to be sent renewal notices on the current day (today's date). Therefore, this list box is always changing from day to day based on the current day. There could be 4 names one day and 7 days the next day. While I'd like only the customer name to appear on the ListBox, below it I want a comment field to appear which will give the user detailed information about the customer like his buying habits, his favorite magazine, etc. I want this comment field to be dynamic so that when the user clicks on a single name entry on the ListBox, the comment field is updated to reflect the information regarding the person whose name is selected. I tried to develop something that would do this but I'm having great difficulty. I believe the key functions to do this are the ItemsSelected, ItemData, etc procedures but I do not know how to make it work. I am not a novice but when I encounter problems like these I feel like one. Can anyone help me retain a measure of confidence?

PS: I also believe the comment field and the customer field must be somehow linked to make this work.
 
re. the P.S. - Yes they must be related. Probably within the same record. Alternatively you could use a separate table that stores the Cust_No and the Cust_Comments.
Re. Referencing List Items. The value of a particular list item can be returned using ItemData. However you must first identify the 'Selected' Item. I have done this by finding the length of the list with ListCount. Then loop through the list and identify the lst.Selected item(i). Once this is done you can use lst.itemdata(i) to condition whatever statement that will find the comments (ie.DLookup)
Mail if you have trouble...
Chris
 
I've used the DLookUp() function but it did not update the "Comments" field when I clicked on a different selection from the listbox.
 
You need to requery the comment field once there has been a change in the Listbox. OnChange or OnClick event. Also watch out for the multiselect property of the list box.
 

Users who are viewing this thread

Back
Top Bottom