Automatic selection of items in a list

paulwilliams

Registered User.
Local time
Today, 12:24
Joined
Jul 27, 2012
Messages
10
Hi Everyone

I'll just quickly say thanks to everyone to posts on this site. I've taken so many solutions away so far that I hope I'll be in a position to give something back at some stage.

In the meantime, however, I have a problem that I'd really appriciate some help with. I'm using Windows 7 x64 and Access 2010 x64.. The premise of my problem is a database that allows sales reps to keep a record of the contact they have made with customers. One of the features is that we mass-send SMS messages to groups of our customers. As such, I have created a "Campaigns List" table to hold the names and IDs of the campaigns and a "Cust-Camp" table to keep a record of which customers are in which lists (as each customer can be in more than one list). When an SMS campaign is sent out, the sales manager creates a single message to go into the contact database, but then manually selects from a list of customers held in a ListBox control. On the click of a button this then adds an entry to the contact table for each selected customer, containing the info the sales manager set. I now have a ComboBox control that sits above the customer list, detailing all the campaign names in the "Campaign List" table. On selecting a campaign from the list, I would like the corresponding customers to be selected in the ListBox.

I may have given more detail here than required and missed out useful information that you need to visualise this problem. I've been trying a few things for about a day now to get this working and am up against a brick-wall. Your assistance would be greatly appriciated - any questions, comments, suggestions greatly appriciated. I'm relatively new to Access but am broadly experienced in Excel and VBA.

Many thanks

Paul
 
This thread should help you out. I am guessing that you will need to open a recordset in the after update event of the combo box to pull the corresponding clients for the selected campain. You would probably have a nested loop with the outer loop being the recordset and the inner loop going through the list box. When a match is found you would select it.

This sounded like an interesting VBA challenge, so I went ahead and gave it a try. Please see the form in the attached example database.
 

Attachments

Hi Jzwp22

That's exactly it! I can't believe you have solved this so quickly. You guys really are an invaluable resource. Thank you thank you.

Best wishes,

Paul
 
You're welcome. I had never done it before, and I thought that it may come in handy in one of my own applications at some point, so I decided to give it a try.
 

Users who are viewing this thread

Back
Top Bottom