Ok I have ' a part of my code, that suspoed to deterime that if the qunaity is great than what we have in stock, a messgae should pop, up and say so, then end the operation. At it's current state, it always ends the operation even if there isn't a problem. here is my code:
Anyhelp would be apprecitated.Code:rivate Sub cmdU_Click() Dim catnumber As String Dim quanty As Integer Dim z As String Dim feild As record ' open the file Open "a:charile2.txt" For Input As #2 Do While Not EOF(2) ' this is in there to see is the S code is working right Input #2, catnumber, quanty, z For x = 1 To LOF(1) / Len(feild) Get #1, x, feild If Trim(feild.Catalog) = catnumber Then If z = "S" Then feild.Quanity = feild.Quanity - quanty End If If z = "R" Then feild.Quanity = feild.Quanity + quanty If z = "D" Then feild.Quanity = feild.Quanity - quanty feild.status = "D" End If 'If quanty > feild.Quanity Then 'MsgBox "Easy there party animal, check that number again." 'End 'End If ' put it to the invenotry file Put #1, x, feild End If Next x Loop Close #2 Kill "a:charile2.txt" Open "a:temp" For Random As #3 Len = Len(feild) y = 1 For x = 1 To LOF(1) / Len(feild) Get #1, x, feild If feild.status <> "D" And feild.Quanity <> 0 Then Form2.Print y Put #3, y, feild y = y + 1 End If Next x Close #1 Close #3 Kill "a:data" Name "a:temp" As "a:data" Open "A:data" For Random As #1 Len = Len(feild) End Sub




Reply With Quote