1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub Command1_Click()
Dim fpiece As Long
Dim unP As Piece
Dim Text1 As String * 6
'ouvrir le fichier fProduit.fp
fpiece = FreeFile() 'freefile() retourne un numéro d'alias libre
Open App.Path & "\" & Fpiecestr For Random Access Write _
As fpiece Len = Len(unP)
While Not EOF(fpiece) And Text1 <> unP.IdPiece
Get fpiece, , unP
Wend
If Not EOF(fpiece) Then
unP.QteStockPiece = Val(Text8)
MsgBox unP.QteStockPiece
Seek fpiece, Loc(fpiece)
Put fpiece, , unP
Else: Exit Sub
End If
Close (fpiece)
End Sub |
Partager