for your modification:
CODE
Sub sTransferPics(ByVal varID As Variant)
' varID is the ID of your student
Dim strSourcePath As String
Dim strTargetPath As String
Dim bolOKToCopy As Boolean
Dim strPictExtension As String * 4
varID = Left(varID, 10)
' TODO: put your source picture folder here
strSourcePath = "C:\TEMP\"
'remove extra "\" if already supplied
strSourcePath = Replace(strSourcePath, "\\", "\")
' TODO: replaced with correct extension
strPictExtension = ".jpg"
' TODO: replace yourComboBox with your combobox name
strTargetPath = "C:\" & yourComboBox.Value & "\"
'remove extra "\" if already supplied
strTargetPath = Replace(strTargetPath, "\\", "\")
' check if the target folder exists
If Dir(strTargetPath, vbDirectory) = "" Then
' does not exists, then create it
MkDir strTargetPath
End If
' will continue copying picture
bolOKToCopy = True
' check if the picture already exists in target folder
If Dir(strTargetPath & varID & strPictExtension) <> "" Then
' already exists, what shall we do
If MsgBox("Picture " & varID & strPictExtension & _
" already exists in " & strTargetPath & "." & vbCrLf & vbCrLf & _
"Do you want to overwrite it?", vbQuestion + vbYesNo) = vbNo Then
' doesn't want to overwrite, so we will not continue
bolOKToCopy = False
Else
' ok to overwrite, well delete it first
Kill strTargetPath & varID & strPictExtension
End If
End If
If bolOKToCopy Then
FileCopy strSourcePath & varID & strPictExtension, strtargetpth & varID & strPictExtension
End If
End Sub