1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| Private Sub numaff_Change()
If faccreation.numaff.ListIndex > 1 Then
' If IsNumeric(Left(faccreation.numaff.Text, InStr(1, faccreation.numaff.Text, "-") - 1)) = True Then
'mise à jour du digit client
faccreation.numclient.Caption = numerosaff.Cells(faccreation.numaff.ListIndex + 6, 5)
'recherche bl
Dim chemin As String
chemin = "C:\Documents and Settings\Scale\Mes documents\GABRIEL PERSO\GESTION VBA\"
dirtest = Dir(chemin & "BL\*")
faccreation.Listblavoir.Clear
While dirtest <> ""
If CInt(Mid(dirtest, InStr(Len(dirtest) - 8, dirtest, "-", vbTextCompare) - 5, 3)) = CInt(Left(faccreation.numaff.Value, InStr(1, faccreation.numaff.Value, "-", vbTextCompare) - 1)) Then
faccreation.Listblavoir.AddItem (Left(dirtest, InStr(1, dirtest, ".") - 1))
' ##
End If
dirtest = Dir
Wend
'recherche avoir
dirtest = Dir(chemin & "AVOIR\*")
While dirtest <> ""
If CInt(Mid(dirtest, InStr(1, dirtest, "-", vbTextCompare), 3)) = CInt(Left(faccreation.numaff.Value, InStr(1, faccreation.numaff.Value, "-", vbTextCompare) - 1)) Then
faccreation.Listblavoir.AddItem (Left(dirtest, InStr(1, dirtest, ".") - 1))
' ##
End If
dirtest = Dir
Wend
'adaptation des conditions de paiements
Call Condition_de_paiement
Else
faccreation.Hide
facmultinumaff.Show
End If
' End If
Call Toutfait
End Sub |
Partager