السلام عليكم
ياشباب الموضوع متعلق بالجريد كنترول
طبعا الجريد كنترول مكون من صفوف واعمده غير محددة العدد
عايز اعمل command لما اضغط عليه يمسح اخر صف انا دخلته
السلام عليكم
ياشباب الموضوع متعلق بالجريد كنترول
طبعا الجريد كنترول مكون من صفوف واعمده غير محددة العدد
عايز اعمل command لما اضغط عليه يمسح اخر صف انا دخلته
فينكم ياشباب محدش ليه معبرنا
ossssa كتب:فينكم ياشباب محدش ليه معبرنا
اخي ارفع المثال لنعدل عليه.. فهذا الامر يعتمد على نوع الجريد المستخدم .
تحياتي
OMANI FOR EVER
-------------------------------------------------

-------------------------------------------------
Dim row As Long
Private Sub cmdSearch_Click()
If Len(Trim(txtItemCode.Text)) <> 4 Then
'cmdSearch.Visible = True
MsgBox "PLEASE ADD 4 DIGITS", vbCritical, "ERROR"
Exit Sub
End If
'Dim ItmFile As FILECTL.File
Dim FileName As String
Dim CurItem As String
Dim Found As Boolean
FileName = "\IN FILE\customerFile.txt"
customerFile.Open FileName, fsModeInput
While Not customerFile.EOF
CurItem = customerFile.LineInputString
Fields = Split(CurItem, ",")
If Fields(0) = txtItemCode.Text Then
Found = True
Label2.Caption = Fields(1)
Label3.Caption = Fields(2)
cmdSearch.Visible = False
Command2.Visible = True
End If
Wend
If Found = False Then
MsgBox "Item Not Found"
End If
Text1.SetFocus
customerFile.Close
End Sub
Private Sub Command2_Click()
Dim vstr As String
If Len(Trim(Text1.Text)) <> 3 Then
Text1.Text = ""
Text1.SetFocus
MsgBox "PLEASE ADD 3 DIGITS", vbCritical, "ERROR"
ElseIf txtItemCode.Text = "" Then
MsgBox "please enter the customer NO", vbCritical, "ERROR"
Exit Sub
End If
FileName = "\in file\itmfile.txt"
ItmFile.Open FileName, fsModeInput
While Not ItmFile.EOF
CurItem = ItmFile.LineInputString
Fields = Split(CurItem, ",")
If Fields(0) = Text1.Text Then
Found = True
'Text2.SetFocus
If SelItems.TextMatrix(row, 3) = "" Then
SelItems.TextMatrix(row, 3) = Text2.Text
SelItems.TextMatrix(row, 0) = Fields(1)
SelItems.TextMatrix(row, 1) = Fields(2)
SelItems.TextMatrix(row, 2) = Fields(3)
SelItems.TextMatrix(row, 5) = SelItems.TextMatrix(row, 3) * SelItems.TextMatrix(row, 2)
MsgBox "choose ctn?", vbYesNo, "please choose"
If MsgBox("choose ctn?", vbYesNo, "please choose") = vbYes Then
SelItems.TextMatrix(row, 4) = "ctn"
ElseIf MsgBox("choose ctn?", vbYesNo, "please choose") = vbNo Then
SelItems.TextMatrix(row, 4) = "pcs"
End If
row = row + 1
SelItems.Rows = SelItems.Rows + 1
cmdSearch.Visible = False
Command2.Visible = True
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
FileName = "\out file\us.txt"
usfile.Open FileName, fsModeAppend
Me.usfile.LinePrint Trim(vstr)
usfile.Close
End If
End If
لا اله الا الله
اخي المقصود بالمثال . ليس كود وانما فورم طبقت عليه ماتريد لنتمكن من تعديل الكود.
تحياتي
OMANI FOR EVER
-------------------------------------------------

-------------------------------------------------