Results 1 to 4 of 4

Thread: Easy to fix for all you wizzards out there

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    143

    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.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    143
    right here:

    Code:
    'If quanty > feild.Quanity Then
                    'MsgBox "Easy there party animal, check that number again."
                    'End
                    'End If

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    143
    anyone, please?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    143
    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
  •  



Click Here to Expand Forum to Full Width