Click here to Skip to main content
15,889,795 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questioncopy to next available row Pin
David Rubin4-Jun-14 5:10
David Rubin4-Jun-14 5:10 
QuestionNeed Help to connect to MQ 7.0 using user id getting 2035 error. Pin
Member 102184182-Jun-14 21:03
Member 102184182-Jun-14 21:03 
QuestionUsing Functions across forms Pin
gwittlock1-Jun-14 16:34
gwittlock1-Jun-14 16:34 
AnswerRe: Using Functions across forms Pin
Peter Leow1-Jun-14 17:12
professionalPeter Leow1-Jun-14 17:12 
GeneralRe: Using Functions across forms Pin
gwittlock1-Jun-14 18:14
gwittlock1-Jun-14 18:14 
AnswerRe: Using Functions across forms Pin
Bernhard Hiller2-Jun-14 0:23
Bernhard Hiller2-Jun-14 0:23 
GeneralRe: Using Functions across forms Pin
gwittlock2-Jun-14 1:14
gwittlock2-Jun-14 1:14 
Questionlistview won't display data populated in vb6 Pin
Dave-1016953130-May-14 6:37
professionalDave-1016953130-May-14 6:37 
This is now solved.

I can walk the code through and watch the data populate but nothing other than the headings are displayed. I am not sure what is different with this compared to others that have been done and i have even compared code and they all work the same so there must be something i am over looking.

VB
Dim nUserID As Long
 Dim sToday  As String
 Dim sUser   As String
 Dim sSQL    As String

 Dim li      As ListItem

 Me.lvMain.ListItems.Clear

 'rsUser.MoveFirst

 Set dbGlob = OpenDatabase(GenPath & "WORORDGB.MDB")
 'Set rsCal = Nothing
 sToday = sDate
 Select Case UCase(sType)

     Case "ALL"            'All

         sSQL = "SELECT * FROM [Accum] WHERE [Type] = 'LABOR' AND [Closed]= 0 AND [WOCounter] <> 0 ORDER BY [Date],[UserID],[Start],[WOCounter]"
         Set rsCal = dbGlob.OpenRecordset(sSQL)
         rsCal.MoveLast
         rsCal.MoveFirst

     Case "WO"      'WO

         Set rsCal = dbGlob.OpenRecordset("SELECT * FROM [Accum] WHERE [Type] = 'LABOR' AND [Closed]= 0 AND [WOCounter] = " & CInt(Trim(Me.cmbWOID.Text)) & " ORDER BY [Date],[UserID],[Start],[WOCounter]")
         rsCal.MoveLast
         rsCal.MoveFirst

     Case "WR"          'WORKER

         Set rsCal = dbGlob.OpenRecordset("SELECT * FROM [Accum] WHERE [Type] = 'LABOR' AND [Closed]= 0 AND [WOCounter] <> 0 AND [UserID]=" & CLng(Me.cmbuserID.Text) & " ORDER BY [Date],[UserID],[Start],[WOCounter]")
         rsCal.MoveLast
         rsCal.MoveFirst

     Case "WRWO"         'Worker - WO

         Set rsCal = dbGlob.OpenRecordset("SELECT * FROM [Accum] WHERE [Type] = 'LABOR' AND [Closed]= 0 AND [WOCounter] = " & CInt(Trim(Me.cmbWOID.Text)) & " AND [UserID]=" & CLng(Me.cmbuserID.Text) & " ORDER BY [Date],[UserID],[Start],[WOCounter]")
         rsCal.MoveLast
         rsCal.MoveFirst

 End Select

 With Me.lvMain
     '.ListItems.Clear
     If rsCal.RecordCount = 0 Then
         Set li = .ListItems.Add(1, "ID" & rsUser.Fields("ID").Value, "Empty", , 4)
         Exit Sub
     End If

     For X = 1 To rsCal.RecordCount

         If IsNull(rsCal.Fields("UserID").Value) Then
             sUser = rsCal.Fields("Desc").Value
         Else
             For Y = 0 To cmbUser.ListCount - 1
                 If CLng(rsCal.Fields("UserID").Value) = CLng(cmbuserID.List(Y)) Then
                     sUser = cmbUser.List(Y)
                     Exit For
                 End If
             Next Y
         End If

         Set li = .ListItems.Add(X, "ID" & rsCal.Fields("Counter").Value, sUser, , 2)
         li.SubItems(1) = Format(rsCal.Fields("Date").Value, "mm/dd/yyyy")
         li.SubItems(2) = Format(rsCal.Fields("Start").Value, "hh:mm ampm")
         li.SubItems(3) = Format(rsCal.Fields("End").Value, "hh:mm ampm")
         li.SubItems(4) = Val(rsCal.Fields("Quantity").Value)
         li.SubItems(5) = rsCal.Fields("WOCounter").Value

         rsCal.MoveNext

     Next X
 End With


modified 30-May-14 15:34pm.

AnswerRe: listview won't display data populated in vb6 Pin
Tim Carmichael30-May-14 9:02
Tim Carmichael30-May-14 9:02 
GeneralRe: listview won't display data populated in vb6 Pin
Dave-1016953130-May-14 9:32
professionalDave-1016953130-May-14 9:32 
QuestionImport from SQL table by column Pin
Member 1066669830-May-14 4:38
Member 1066669830-May-14 4:38 
AnswerRe: Import from SQL table by column Pin
Eddy Vluggen30-May-14 10:43
professionalEddy Vluggen30-May-14 10:43 
AnswerRe: Import from SQL table by column Pin
Mycroft Holmes30-May-14 13:01
professionalMycroft Holmes30-May-14 13:01 
GeneralRe: Import from SQL table by column Pin
Member 106666981-Jun-14 22:40
Member 106666981-Jun-14 22:40 
GeneralRe: Import from SQL table by column Pin
Member 106666981-Jun-14 22:59
Member 106666981-Jun-14 22:59 
GeneralRe: Import from SQL table by column Pin
Mycroft Holmes2-Jun-14 0:53
professionalMycroft Holmes2-Jun-14 0:53 
GeneralRe: Import from SQL table by column Pin
Member 106666982-Jun-14 4:49
Member 106666982-Jun-14 4:49 
GeneralRe: Import from SQL table by column Pin
Eddy Vluggen2-Jun-14 8:23
professionalEddy Vluggen2-Jun-14 8:23 
GeneralRe: Import from SQL table by column Pin
Member 106666982-Jun-14 20:42
Member 106666982-Jun-14 20:42 
QuestionIIf Statement - Different Problem With RDLC Pin
Paramu197329-May-14 15:05
Paramu197329-May-14 15:05 
QuestionActivex code to print pdf files on client machine Pin
Sachin Mehndiratta29-May-14 2:55
Sachin Mehndiratta29-May-14 2:55 
QuestionClose a form at a specific moment Pin
dilkonika28-May-14 6:32
dilkonika28-May-14 6:32 
AnswerRe: Close a form at a specific moment Pin
Eddy Vluggen28-May-14 7:28
professionalEddy Vluggen28-May-14 7:28 
GeneralRe: Close a form at a specific moment Pin
dilkonika28-May-14 8:31
dilkonika28-May-14 8:31 
QuestionRe: Close a form at a specific moment Pin
Eddy Vluggen28-May-14 9:30
professionalEddy Vluggen28-May-14 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.