![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2007
Posts: 1
Rep Power: 0
![]() |
SQL in VB 6
Hi,
I am trying to input all the contents from a table into a VB flex grid which I am able to do. Then I want to create another loop just for one item in the flex grid. In this loop, the original data in the flex grid is a number. I want to take this number and check for its corresponding string value in another table. With the code below, I get the same string value from the second table for all the original numbers in the flexgrid. Below is my code: ===== intj = 1 Do Until rs.EOF = True 'do until all records in recordset DoEvents inti = 0 Do Until inti = rs.Fields.Count 'loop start DoEvents If Not IsNull(rs.Fields(inti)) Then MSHFlexGrid1.Row = intj MSHFlexGrid1.Col = inti MSHFlexGrid1.TextMatrix(intj, 0) = rs.Fields("CaseID").Value MSHFlexGrid1.TextMatrix(intj, 1) = rs.Fields("UserID").Value MSHFlexGrid1.TextMatrix(intj, 2) = rs.Fields("ApplicationID").Value MSHFlexGrid1.TextMatrix(intj, 3) = rs.Fields("Problem").Value MSHFlexGrid1.TextMatrix(intj, 4) = rs.Fields("Time_Working").Value MSHFlexGrid1.TextMatrix(intj, 5) = rs.Fields("Time_Open").Value MSHFlexGrid1.TextMatrix(intj, 6) = rs.Fields("QueueID").Value End If inti = inti + 1 Loop 'loop end ApplicationID = MSHFlexGrid1.TextMatrix(intj, 2) AppIDTemp = "select Application from tbl_Applications where ApplicationID = ApplicationID" conn.Execute AppIDTemp ApplicationName = rs1.Fields("Application").Value MSHFlexGrid1.TextMatrix(intj, 2) = ApplicationName MSHFlexGrid1.Rows = MSHFlexGrid1.Rows + 1 intj = intj + 1 rs.MoveNext Loop ===== Thanks for your help. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting to SQL Server 2005 | Robocop | Visual Basic .NET | 2 | Nov 11th, 2007 11:37 AM |
| Importing a file using VB | u2cannv | Visual Basic | 3 | Oct 22nd, 2007 2:48 PM |
| VB using Access | u2cannv | Visual Basic | 4 | Oct 19th, 2007 11:25 AM |
| VB 2002 -> VB 2008 conversion | pal | Visual Basic .NET | 1 | Sep 15th, 2007 3:43 AM |
| Detach an in-use database via code (SQL Server 2000) | sma_soft | C# | 1 | Aug 14th, 2007 2:22 PM |