View Single Post
 
Old 05-11-2011, 11:05 AM
Cbrehm Cbrehm is offline Windows 7 64bit Office 2003
Novice
 
Join Date: May 2011
Posts: 8
Cbrehm is on a distinguished road
Default While loop not working right

I must be crazy because no matter what it stays at good=true
Sub called from userform addcort

Code:
Private Sub addcozip_AfterUpdate()
    'get zip and call sub to add city and state to textboxes
    'this error checking really need to be in the sub addzip
  
  Dim good As Boolean
    'CHECK TO SEE IS ZIP EXISTS 71889 DOES NOT FOR TESTING
  good = IsError(Application.Match(addcozip.Value, Range("zipcode").Columns(1), 0))
    
While good = True
  If good = True Then
        'if zip does not exist get user inout for a good zip
     addcozip.Value = InputBox("The zip code you entered does not exist. Please enter a valid zip code")
        
     
  Else
       
  End If
        'CHECK TO SEE IS ZIP EXISTS
    good = IsError(Application.Match(addcozip.Value, Range("zipcode").Columns(1), 0))


Wend

    'call sub to get city and state, addzip is in module GBLSUBS
addzip addcozip, ADDcoCT, addcostate


End Sub
Attached Files
File Type: xls Tax sale program.xls (263.0 KB, 9 views)
Reply With Quote