Help With List Box Options

losthome

Registered User.
Local time
Today, 17:49
Joined
May 17, 2002
Messages
25
Hi There,

I hope someone can help me figure out how to write the code for my problem.

What I want to do is a bit complex (to me) so I will try and explain it well.

Scenario [/U]

I have courses employees can take eg:

Oreintation
NHL information
Snowboard Anatomy

I have 100 employees that take may take these courses.

What I want to do is pick the course say "Snowboard Anatomy" and then click on the employees from say a list box and it will transfer the names I click onto into a different list box who actually took the course.

So Bill, Tom, Jane, Jen took Snowboard Anatomy. (Jeff, Dick, Jade didn't take it) so I wouldn't click on there names.

It is like when you use a wizard and it allows you to choose certain items and not others. This is what I am trying to do.

I hope I have explained this well.


Thanks for your help.

Jennifer
 
Hi Jennifer,

There must be lots of ways of doing this...

Using 2 List boxes -

1st List box has query linked to table with course names.
2nd List Box has query linked to table with members.

Button ('Select') adjacent to ListBox 2 to make choice.

In ONCLICK property of Button -

Dim MyDb As Database, Myset As Recordset
MyDb=DBEngine.Workspaces(0).Databases(0)
MySet=OpenRecordset ("MyTable")

MySet.AddNew
MySet![Member]=Me!ListBox1
MySet![Course]=Me!ListBox2
MySet.Update

MySet.Close
MyDb.Close


Of course, this is a simplistic solution since you may only want to store the ID for each Member and the course code for the course. You will also want to store a unique primary key for the record, but this can be done simply having an AUTONUMBER in the table which will require no further code since it increments automatically on a new record input.

HTH

Dave E
 

Users who are viewing this thread

Back
Top Bottom