Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Selected records

Status
Not open for further replies.

brews

Technical User
Dec 12, 2007
194
US
Converting from VB6 and CR9 to VS2008 and CR2008. Have a module that is identical in both however the VB6 part prints exactly as it should where the VS2008 part prints all available records.

A listview with checkboxes is populated with the records to be printed. The user chooses which records and this sub is used to print the records:
Code:
     Private Sub ToolStripPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripPrint.Click, PrintToolStripMenuItem.Click
        bComplete = True
        cCol = New Collection
        For Each Me.xItem In lvwPrintNameTag.Items          'loop through each item in the listview
            If xItem.Checked Then                                        'check for selected item'
                cCol.Add(xItem.Text)                     'add to the collection
            End If
        Next
        If cCol.Count = 0 Then
            MsgBox("Nothing checked", vbInformation)
            Exit Sub
        Else
            For i = 1 To cCol.Count
                iID = cCol.Item(i)
                dataMgr.FindOneName(iID, mMem)             'Gets all info to update record
                mMem.PrintNameTag = True                'reason to update record so that record
                dataMgr.UpdateMembers(iID, mMem)           ' is not printed second time
            Next
            With frmPrintTagAdhesiveSelected
                .Text = "Name Tags - Adhesive"
                .Width = 890
                .Height = 1000
                .Top = 10
                .Show()
            End With
        End If
    End Sub

xItem and dataMgr are procedure wide. The collection, cCol, holds the number of records checked. What needs to be changed for this to work in vs2008/cr2008?

Thanks.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top