Transfer data 1 form to another

Precips1

Registered User.
Local time
Today, 22:36
Joined
Dec 28, 2010
Messages
35
Hi,
Been pondering over this problem for some time now!

What I'm trying to do seems quite simple in my head and happens lots of times in lots of applications. Copy and transfer selected data like names from one table to another.

I have one table called "Attendees" which holds peoples names. Then another table called "Events" which holds course details like fork lift truck, confined space etc...

What I'm trying to do is create a form which will show at the top a combo box drop down showing all courses on the system - I've done that!

Below is a listbox showing all the people currently in the system "Attendees". Done that!

To the side - I have a subform which shows the people names that have completed the course. Eg. If I select fork lift truck from the "Events" dropdown, it shows 3 people have completed this course, select confined space it shows 5 people completed and so on.

What I'm looking for is a button in the middle so I can select people’s names from the left "Attendees" table and copy them to the right "Events" table or even better multi-select people and transfer multiple people at once.

I've found a couple of examples on the net but none simple enough for me to get my head around.

Help is much appreciated

Mike
 
It seems to me you're going to need:

Code in the ListBox AfterUpdate event to check whether any are selected and enable/disable the button accordingly

Code in the button's click event:
Open a recordset of 'Events' (the table - that's an overloaded word in your database ;) )
For each item selected in the ListBox add a record to the recordset with the corresponding data.


To write the code we'd need to know the name of the listbox and its columns. If it really just contains the IDs of the Attendees we'd need to know the relevant field names in that table. Also, the relevant fieldnames in the Events table including any required fields.
 
VilaRestal, thanks for the help...

I've call the people names listbox - [lstWanted] with 2 columns showing AttendeeFirstName & AttendeeLastName.

For the Events form I only need to see peoples names that have completed the course so I'm just showing their names which at the minute its [AttendeeLastName] & ", " & [AttendeeFirstName] added together.

Mike

Ps - I've added a small screen shot for you to see what I'm looking at.
Mike
 

Attachments

  • Pic1.jpg
    Pic1.jpg
    96.8 KB · Views: 142

Users who are viewing this thread

Back
Top Bottom