Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15215

Query value from Table (Excel File)

$
0
0
Hello, I have this code that work



Code:

Dim T As Table= C("someModelTable")  'C mean copy the table(someModelTable),this command come from the software from where I work
Dim Rows() As Integer = T.StartQuery

For i As Integer = 0 To Rows.Length-1 
        Dim model As String 
        model = (T.Cell( Rows(i) , "Code") ) 
        If Q("TXB_CODE_ING").Contains(model) Then        'Q mean query  the value
                Q("CMB_Catalog_Number")  = model             
        End If         
Next i

As I said this code work, it will display the model that it find in a textbox in a cmbbox.

There problem I have is if I want to add a "else if" in case the model is not valid, well the program will always go to this "else if" , like if the model is never valid.
I beginner but I just don't understand why, do its because I work with a Excel file??

Thank you!

Viewing all articles
Browse latest Browse all 15215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>