Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
Simple Particle Engine for a shooter game
Snake / Nibbles clone in C and Ncurses
Please improve
Parsing of XML data has high CPU usage
Convert simple Javascript to jQuery plugin
Active Record getting unique records
List the files in a directory without the directory name or the extension
clean the code
ohs system, recruitment software, hr software, oh&s software, human resources software, ohs software
Array parsing in a block
Popular
Parsing of XML data has high CPU usage
Please improve
Snake / Nibbles clone in C and Ncurses
List the files in a directory without the directory name or the extension
Convert simple Javascript to jQuery plugin
Simple Particle Engine for a shooter game
Active Record getting unique records
Breadth first cartesian product iterator
php refactoring
first BST
Pastable version of
Many-to-many list box interface
<pre class='prettyprint' language='asp_vb.net'>Private Sub cmdAddAmbassador_Click() ' Run when the user clicks the "<" button to add an ambassador to an event ' Need to make sure varItem is the right kind of object Dim varItem As Variant ' Get rid of those pesky "You are about to append 1 row" warnings. ' This also supresses important error messages, so should be commented ' out for debugging. DoCmd.SetWarnings (False) ' Loop through all the items selected in the "Available ambassadors" list For Each varItem In Me.lstAvailableAmbassadors.ItemsSelected ' Add the selected person to the current event, by creating a new record ' in the join table DoCmd.RunSQL "INSERT INTO AmbassadorWork VALUES (" & Me.ID & "," _ & Me.lstAvailableAmbassadors.Column(3, varItem) & ",NULL,NULL);" Next ' Reload the list boxes so that they contain up-to-date information Me.lstAvailableAmbassadors.Requery Me.lstWorkingAmbassadors.Requery End Sub Private Sub cmdRemoveAmbassador_Click() ' Run when the user clicks the ">" button to remove an ambassador from an event Dim varItem As Variant DoCmd.SetWarnings (False) ' Loop through selected items in the list For Each varItem In Me.lstWorkingAmbassadors.ItemsSelected ' Remove the selected person from the current event by deleting the record ' which links the person with this event from the join table DoCmd.RunSQL "DELETE FROM AmbassadorWork WHERE (" & "EventID = " & Me.ID _ & " AND AmbassadorID = " & Me.lstWorkingAmbassadors.Column(3, varItem) & ");" Next ' Reload the list boxes so that they contain up-to-date information Me.lstAvailableAmbassadors.Requery Me.lstWorkingAmbassadors.Requery End Sub</pre> <a href="http://www.refactormycode.com/codes/1157-many-to-many-list-box-interface" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>