I'm writing a program for my department at work and its almost like 2 programs in one. Instead of using a seperate table for each one i'm using a single table and added a LogType field to distinguish between the 2. My problem is that when i try to populate the MSFlexGrid it's just blank. Here's my code, i'm using 2 radio buttons:
VB Code:
Dim intRSCounter As Integer Select Case Index Case 0 rsFilter.Open "SELECT * FROM CMELNRN WHERE LogType = 'CMEL'", cnCMELNRN, adOpenStatic, adLockOptimistic, adCmdText With msgCMELNRN .Rows = rsFilter.RecordCount + 1 For intRSCounter = 1 To rsFilter.RecordCount .Row = intRSCounter .Col = 0 .Text = rsFilter!AnalystName .Col = 1 .Text = rsFilter!InputDate .Col = 2 .Text = rsFilter!TimeStarted .Col = 3 .Text = rsFilter!Comments .Col = 4 .Text = rsFilter!Event .Col = 5 .Text = rsFilter!TimeEnded .Col = 6 .Text = rsFilter!ClosingAnalyst .Col = 7 .Text = rsFilter!EventStatus .Col = 8 .Text = rsFilter!Contact rsFilter.MoveNext Next intRSCounter End With rsFilter.Close Case 1 rsFilter.Open "SELECT * FROM CMELNRN WHERE LogType = 'NRN'", cnCMELNRN, adOpenStatic, adLockOptimistic, adCmdText With msgCMELNRN .Rows = rsFilter.RecordCount + 1 For intRSCounter = 1 To rsFilter.RecordCount .Row = intRSCounter .Col = 0 .Text = rsFilter!AnalystName .Col = 1 .Text = rsFilter!PersonContacted .Col = 2 .Text = rsFilter!InputDate .Col = 3 .Text = rsFilter!TimeStarted .Col = 4 .Text = rsFilter!RequiredContact .Col = 5 .Text = rsFilter!Comments .Col = 6 .Text = rsFilter!Issue rsFilter.MoveNext Next intRSCounter End With rsFilter.Close End Select
Can anyone tell me why the grid isn't populating and also how i can get it to work? Thanks.





Reply With Quote