|
-
May 28th, 2002, 03:30 PM
#1
Thread Starter
Addicted Member
Easy to fix for all you wizzards out there
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:
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
Anyhelp would be apprecitated.
-
May 28th, 2002, 03:55 PM
#2
Thread Starter
Addicted Member
right here:
Code:
'If quanty > feild.Quanity Then
'MsgBox "Easy there party animal, check that number again."
'End
'End If
-
May 28th, 2002, 04:24 PM
#3
Thread Starter
Addicted Member
-
May 28th, 2002, 05:45 PM
#4
Thread Starter
Addicted Member
BUMP
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|