-
Jun 8th, 2021, 02:43 PM
#1
Thread Starter
Junior Member
[RESOLVED] Query value from Table (Excel File)
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!
Last edited by VirtualTurnip3; Jun 8th, 2021 at 02:54 PM.
-
Jun 8th, 2021, 08:23 PM
#2
Re: Query value from Table (Excel File)
If you want help with code that doesn't work, maybe you could show us that code.
-
Jun 8th, 2021, 09:06 PM
#3
Thread Starter
Junior Member
Re: Query value from Table (Excel File)
Originally Posted by jmcilhinney
If you want help with code that doesn't work, maybe you could show us that code.
You right! It seem I forgot to copy it, but by the time I have found my problem, I forget a simple "Exit for".
Thank!
-
Jun 8th, 2021, 09:53 PM
#4
Re: Query value from Table (Excel File)
I'm not sure how you found the issue in the end but this is why you need to use the debugger and you need to do so before posting a question. Set a breakpoint at the top of the code and then step through it line by line. You can then see exactly what path execution takes and what values all your variables and other expressions contain and compare that to your expectations. That will almost always show you WHERE the issue is and WHAT the issue is, even if it doesn't tell you how to fix it. You need to provide us with that debugging information.
-
Jun 8th, 2021, 09:53 PM
#5
Re: Query value from Table (Excel File)
If your problem has been resolved, please use the Thread Tools menu to mark this thread Resolved, so everyone knows that you need no more help without opening the thread and read it all.
-
Jun 9th, 2021, 11:00 AM
#6
Thread Starter
Junior Member
Re: Query value from Table (Excel File)
Originally Posted by jmcilhinney
I'm not sure how you found the issue in the end but this is why you need to use the debugger and you need to do so before posting a question. Set a breakpoint at the top of the code and then step through it line by line. You can then see exactly what path execution takes and what values all your variables and other expressions contain and compare that to your expectations. That will almost always show you WHERE the issue is and WHAT the issue is, even if it doesn't tell you how to fix it. You need to provide us with that debugging information.
Allright no problem!
-
Jun 9th, 2021, 12:35 PM
#7
Thread Starter
Junior Member
Re: Query value from Table (Excel File)
Last edited by VirtualTurnip3; Jun 9th, 2021 at 12:43 PM.
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
|