[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1087
  • Last Modified:

Emergency Problem with Controls

Please help.  I am trying to simply get this application that was built about 2 years ago, compiled and packaged.  I keep getting the following errors:

Line 17: Class TrueOleDBList80.TDBCombo of control cmbDocumentType was not a loaded control class.
Line 166: Class TrueOleDBList80.TDBCombo of control cmbFileType was not a loaded control class.
Line 323: Class TrueOleDBList80.TDBList of control lstItemDataHistory was not a loaded control class.
Line 480: Class TrueDBList80.TDBList of control lstItemData was not a loaded control class.

Here is the code its referencing in its entirty.

Thanks for the help:
CR

============CODE==============

Public stMode As String                             'Determines the screen mode.  Attachment, Copy, or Scan
Public stFileType As String                         'File Type being scanned, attached, or copied
Public stDestinationFile As String                  'Full path and filename of destination file.
Public stSourceFile As String                       'Sourcefile to be copied
Public stpath As String                             'Path file will be stored
Public intDocSeq As Integer                         'Next Available Doc Seq for this Item Number
Public stMisc1 As String                            'Holds misc info about Item that we want to save
Public stMisc2 As String                            'Holds misc info about Item that we want to save
Public blValid As Boolean                           'Is this a valid item number
Public stTempFileName As String                     'Stores new file name
Public stCurrentListState                           'Determines what the current FileType is when changeing to a new type
Public intStart As Integer                          'Used to Replace a "\" and "/" with an "_" so that it can be used as a proper filename.
Public intCounter As Integer                        'Used to Replace a "\" and "/" with an "_" so that it can be used as a proper filename.
Public intCount As Integer                          'Used to count the number of documents being attached
Public stconn As New ADODB.Connection               'Connection to SQL Server Datasource (Set in the DocumentLoginForm)
Public cmdPath As New ADODB.Command
Public cmdDocumentType As New ADODB.Command
Public cmdDocSeq As New ADODB.Command
Public cmdItemData As New ADODB.Command
Public cmdAddItem As New ADODB.Command
Public rsAddItem As New ADODB.Recordset             'Used when adding a new item to the Documents table
Public rsPath As New ADODB.Recordset                'Used to retreive the current FileType Path
Public rsItemData As New ADODB.Recordset            'Used to verify the current item number is valid
Public rsDocSeq As New ADODB.Recordset              'Used to retrieve the last Doc Seq number for the current item
Public rsDocumentType As New ADODB.Recordset        'Used to retrieve a valid list of Document Types for this File Type
Private Sub btnClearHistory_Click()
    lstItemDataHistory.Clear
End Sub
Private Sub cmbFileType_GotFocus()
    cmbFileType.EditBackColor = &H80FFFF
End Sub
Private Sub cmbFileType_LostFocus()
    cmbFileType.EditBackColor = &H80000005
End Sub
Private Sub txtItemData_GotFocus()
    txtItemData.BackColor = &H80FFFF
End Sub
Private Sub txtItemData_LostFocus()
    txtItemData.BackColor = &H80000005
End Sub
Private Sub cmbDocumentType_GotFocus()
     cmbDocumentType.EditBackColor = &H80FFFF
End Sub
Private Sub cmbDocumentType_LostFocus()
    cmbDocumentType.EditBackColor = &H80000005
End Sub
Private Sub txtDescription_GotFocus()
    txtDescription.BackColor = &H80FFFF
End Sub
Private Sub txtDescription_LostFocus()
    txtDescription.BackColor = &H80000005
End Sub
Private Sub Form_Load()
    CleanUp
    lstItemData.AddItem temp, 0
    lstItemData.Clear
    lstItemDataHistory.Clear
    lstItemDataHistory.Columns(0).Caption = "History"
    lstItemDataHistory.Columns(1).Visible = False
    Select Case stMode
        Case "SCAN"
            DocumentAttach.Caption = "Document Scan - User: " & DocumentLogin.stCurrentUser
            lblSourceFile.Visible = False
            txtSourceFile.Visible = False
            btnFileSearch.Visible = False
            chkShowUI.Visible = True
            cmbDocumentType.Visible = True
            lblDocumentType.Visible = True
            btnSave.Caption = "&Scan"
        Case "ATTACH"
            DocumentAttach.Caption = "Document Attachment - User: " & DocumentLogin.stCurrentUser
            lblSourceFile.Visible = True
            txtSourceFile.Visible = True
            btnFileSearch.Visible = True
            chkShowUI.Visible = False
            cmbDocumentType.Visible = True
            lblDocumentType.Visible = True
            btnSave.Caption = "&Save"
    End Select
    stconn.Open DocumentLogin.stConnection
    Set cmdPath.ActiveConnection = stconn
    cmdPath.CommandText = "SELECT * from pathmaint"
    rsPath.CursorLocation = adUseClient
    rsPath.Open cmdPath, , adOpenStatic, adLockReadOnly
    Set cmdDocumentType.ActiveConnection = stconn
    If DocumentLogin.blSingleMode = False Then
        cmbFileType.AddItem "Job"
        cmbFileType.AddItem "Part"
        cmbFileType.AddItem "Sales Order"
        cmbFileType.AddItem "RMA"
       ' cmbFileType.AddItem "Customer"
        'cmbFileType.AddItem "Vendor"
        'cmbFileType.AddItem "Purchase Order"
        'cmbFileType.AddItem "Accounts Payable"
        cmbFileType.AddItem "Other"
        cmbFileType.Text = cmbFileType.Columns.Item(0)
        cmbFileType.Columns(1).Visible = False
        cmbFileType.AlternatingRowStyle = True
        btnFileSearch.Enabled = False
        PopulateDocumentType
    Else
        txtItemData.Text = DocumentLogin.stDocNumber
        stFileType = DocumentLogin.stDocType
        Select Case DocumentLogin.stDocType
            Case "Part"
                cmbFileType.Text = "Part"
            Case "Job"
                cmbFileType.Text = "Job"
                txtItemData.Text = DocumentLogin.stDocNumber
            Case "SO"
                cmbFileType.Text = "Sales Order"
                txtItemData.Text = DocumentLogin.stDocNumber
            Case "RMA"
                cmbFileType.Text = "RMA"
                txtItemData.Text = DocumentLogin.stDocNumber
            Case "Customer"
                cmbFileType.Text = "Customer"
                txtItemData.Text = DocumentLogin.stDocNumber
            Case "Vendor"
                cmbFileType.Text = "Vendor"
            Case "PO"
                cmbFileType.Text = "Purchase Order"
            Case "AP"
                cmbFileType.Text = "Accounts Payable"
            Case Else
                temp = MsgBox("There was an Error.  There was no Document Type Provided.")
                DocumentTracker.Visible = True
                DocumentAttach.Visible = False
        End Select
        GetDocSeq   'Get the next available document seq number
        stMisc1 = DocumentLogin.stDocMisc1
        stMisc2 = DocumentLogin.stDocMisc2
        Select Case stFileType
        Case "Part"
            temp = txtItemData & ";" & intDocSeq
        Case "Job"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1
        Case "SO"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "RMA"
            temp = txtItemData & ";" & intDocSeq
        Case "Customer"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "Vendor"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "PO"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "AP"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "Other"
            'FIX
        End Select
        PopulateDocumentType
        lstItemData.AddItem temp, 0
        txtItemData.Text = ""
        cmbDocumentType.Enabled = True
        txtDescription.Enabled = True
        cmbDocumentType.BackColor = &H80000005
        txtDescription.BackColor = &H80000005
        btnSave.Enabled = True
        btnFileSearch.Enabled = True
        btnRemove.Enabled = True
        btnMemo.Enabled = True
    End If
 
End Sub
Private Sub Form_Unload(Cancel As Integer)
    stCurrentListState = ""
    lstItemData.Clear
    If DocumentTracker.blChanged = True Then
    DocumentTracker.cmbDocumentType_ItemChange
    End If
    DocumentTracker.Show
    Unload Me
End Sub
Private Sub btnCancel_Click()
    Unload Me
End Sub
Function ReplaceFSlash(intStart As Integer, stTempFileName As String) As String
    Mid(stTempFileName, intStart, 1) = "_"  'Replaces the "\" with an "_" so that it can be used as a proper filename.
    ReplaceFSlash = stTempFileName
End Function
Function ReplaceBSlash(intStart As Integer, stTempFileName As String) As String
    Mid(stTempFileName, intStart, 1) = "__" 'Replaces the "/" with an "__" so that it can be used as a proper filename.
    ReplaceBSlash = stTempFileName
End Function
Private Sub btnAdd_Click()
    txtItemData.Text = lstItemDataHistory.Columns(0).Value
    AddItem
End Sub
Private Sub btnRemove_Click()
    If lstItemData.ApproxCount > 0 Then
        bk = lstItemData.Bookmark
        If Not IsNull(bk) Then
            'txtItemData.Text = lstItemData.Columns(0).Value
            lstItemData.RemoveItem lstItemData.SelectedItem
        Else
            temp = MsgBox("There is no item selected")
            Exit Sub
        End If
    End If
    txtItemData_Change
End Sub
Private Sub btnLookup_Click()
    DocumentItemLookup.Show
    DocumentAttach.Hide
End Sub
Private Sub btnMemo_Click()
    DocumentLogin.stbtnMemo = "DocumentAttach"
    DocumentMemo.txtDescription.Text = txtDescription.Text
    DocumentMemo.Show
    DocumentAttach.Hide
End Sub
Private Sub txtDescription_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        If btnSave.Caption = "&Save" Then
            btnFileSearch.SetFocus
        Else
            btnSave.SetFocus
        End If
    End If
End Sub
Private Sub cmbDocumentType_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        txtDescription.SetFocus
    End If
End Sub
Private Sub btnFileSearch_Click()
    CommonDialog1.DialogTitle = "File to Import"
    CommonDialog1.Filter = "all files|*.*|picture files|*.bmp;*.dib;*.jpg;*.pcx;*.png;*.tga;*.tif|BMP|*.bmp|PDF|*.pdf|DIB|*.dib|JPEG|*.jpg|PCX|*.pcx|PNG|*.png|Targa|*.tga|TIFF|*.tif"
    CommonDialog1.FilterIndex = 1
    CommonDialog1.ShowSave
    txtSourceFile.Text = CommonDialog1.FileName
    btnSave.Enabled = True
    btnSave.SetFocus
End Sub
Private Sub cmbFileType_ItemChange()
    txtItemData.Text = ""
    txtSourceFile.Text = ""
    lstItemData.Clear
    lstItemDataHistory.Clear
    btnSave.Enabled = False
    PopulateDocumentType
End Sub
Private Sub cmbFileType_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        txtItemData.SetFocus
    End If
End Sub
Private Sub txtItemData_Change()
    If lstItemData.ApproxCount <= 1 Then
        btnRemove.Enabled = False
        cmbDocumentType.Enabled = False
        txtDescription.Enabled = False
        cmbDocumentType.BackColor = &H8000000F
        txtDescription.BackColor = &H8000000F
        btnFileSearch.Enabled = False
        btnMemo.Enabled = False
    End If
End Sub


Private Sub txtItemData_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        If txtItemData.Text = "" Then
            DocumentItemLookup.Show
            DocumentAttach.Hide
        Else
            AddItem
        End If
    End If
End Sub

Private Sub btnSave_Click()
    DocumentTracker.blChanged = True
    GetFileTypePath
    CleanUp
    stconn.Open DocumentLogin.stConnection
    Set cmdAddItem.ActiveConnection = stconn
    cmdAddItem.CommandText = "SELECT * from Documents"
    rsAddItem.CursorLocation = adUseClient
    rsAddItem.Open cmdAddItem, , adOpenStatic, adLockOptimistic
    intCount = 1
    Do Until lstItemData.ApproxCount = 0
        rsAddItem.AddNew
        rsAddItem.Fields("Filetype") = stFileType
         Select Case stFileType
            Case "Part"
                stTempFileName = lstItemData.Columns(0).Value
                rsAddItem.Fields("PartNumber") = lstItemData.Columns(0).Value
            Case "Job"
                stTempFileName = lstItemData.Columns(0).Value
                rsAddItem.Fields("JobNumber") = lstItemData.Columns(0).Value
                rsAddItem.Fields("PartNumber") = lstItemData.Columns(2).Value
            Case "SO"
                stTempFileName = lstItemData.Columns(0).Value
                rsAddItem.Fields("SalesOrderNumber") = lstItemData.Columns(0).Value
                rsAddItem.Fields("CustomerName") = lstItemData.Columns(2).Value
                rsAddItem.Fields("CustomerNumber") = lstItemData.Columns(3).Value
            Case "RMA"
                stTempFileName = lstItemData.Columns(0).Value
                rsAddItem.Fields("RMANumber") = lstItemData.Columns(0).Value
            Case "Customer"
                rsAddItem.Fields("CustomerNumber") = txtItemData.Text
                rsAddItem.Fields("CustomerName") = txtItemData.Text
            Case "Vendor"
                rsAddItem.Fields("VendorNumber") = txtItemData.Text
                rsAddItem.Fields("VendorName") = txtItemData.Text
            Case "PO"
                rsAddItem.Fields("PONumber") = txtItemData.Text
                rsAddItem.Fields("VendorName") = txtItem.Text
            Case "Other"
                rsAddItem.Fields("OtherNumber") = txtItemData.Text
        End Select
        intStart = 1    'Replaces the "\" with an "_" so that it can be used as a proper filename.
        intCounter = 1
        Do Until intCounter = 0
            intCounter = InStr(intStart, stTempFileName, Chr(47))
            intStart = intCounter + 1
            If intCounter > 0 And Not IsNull(intCounter) Then
                stTempFileName = ReplaceFSlash(intCounter, stTempFileName)
            End If
        Loop
        intStart = 1    'Replaces the "/" with an "__" so that it can be used as a proper filename.
        intCounter = 1
        Do Until intCounter = 0
            intCounter = InStr(intStart, stTempFileName, Chr(92))
            intStart = intCounter + 1
            If intCounter > 0 And Not IsNull(intCounter) Then
                stTempFileName = ReplaceBSlash(intCounter, stTempFileName)
            End If
        Loop
        rsAddItem.Fields("DocumentSeq") = lstItemData.Columns(1).Value
        rsAddItem.Fields("DocumentType") = cmbDocumentType.Text
        rsAddItem.Fields("DocumentDesc") = txtDescription.Text
        rsAddItem.Fields("EntryDate") = Date
        rsAddItem.Fields("EntryPerson") = DocumentLogin.stCurrentUser
        Select Case stMode
            Case "ATTACH"
                rsAddItem.Fields("FileName") = stTempFileName & "-" & lstItemData.Columns(1) & "." & Right(txtSourceFile.Text, 3)
            Case "SCAN"
                rsAddItem.Fields("FileName") = stTempFileName & "-" & lstItemData.Columns(1) & ".tif"
        End Select
        rsAddItem.Update
        Select Case stMode
            Case "ATTACH"
                stSourceFile = txtSourceFile.Text
                stDestinationFile = stpath & stTempFileName & "-" & lstItemData.Columns(1) & "." & Right(txtSourceFile.Text, 3)
                FileCopy stSourceFile, stDestinationFile
            Case "SCAN"
                If intCount = 1 Then
                    intCount = intCount + 1
                    DocumentTracker.stpath = stpath
                    DocumentTracker.stFilename = stTempFileName & "-" & lstItemData.Columns(1) & ".tif"
                    TwainPRO.OpenSession
                    If chkShowUI.Value = 1 Then
                        TwainPRO.ShowUI = True
                    Else
                        TwainPRO.ShowUI = False
                    End If
                    m_ImageCount = 0
                    TwainPRO.StartSession
                Else
                    stSourceFile = DocumentTracker.stpath & DocumentTracker.stFilename
                    stDestinationFile = stpath & stTempFileName & "-" & lstItemData.Columns(1) & ".tif"
                    FileCopy stSourceFile, stDestinationFile
                End If
            End Select
        lstItemData.RemoveItem (0) 'Removes Item from List
    Loop
    cmbDocumentType.Enabled = False
    cmbDocumentType.BackColor = &H8000000F
    txtDescription.Text = ""
    txtDescription.BackColor = &H8000000F
    txtDescription.Enabled = False
    btnMemo.Enabled = False
    btnSave.Enabled = False
    cmbFileType.BackColor = &H80000005
    Select Case stMode
        Case "ATTACH"
            If DocumentLogin.blApplicationLaunch = True Then 'Added for Deneise
                If DocumentLogin.stDocType = "SO" Then
                    End
                End If
            End If
            btnSave.Enabled = False
            btnFileSearch.Enabled = False
            btnFileSearch.Enabled = False
            txtSourceFile.Text = ""
            txtDescription.Text = ""
            txtDescription.BackColor = &H8000000F
            btnMemo.Enabled = False
            cmbDocumentType.BackColor = &H8000000F
            cmbDocumentType.Enabled = False
        Case "SCAN"
            If DocumentLogin.blApplicationLaunch = True Then 'Added for Deneise
                If DocumentLogin.stDocType = "SO" Then
                    End
                End If
            End If
            DocumentViewer.stLaunchForm = "DocumentAttach"
            DocumentViewer.Show
            DocumentAttach.Hide
    End Select
End Sub
Private Sub TwainPRO_PostScan(Cancel As Boolean)
    TwainPRO.CutToClipboard
    IXP.Paste
    IXP.Rotate 180
    IXP.CropBorder 0.99, 4
    IXP.Deskew
    IXP.ZoomToFit 0
    IXP.SaveMultiPage = True
    IXP.SaveFileName = DocumentTracker.stpath & DocumentTracker.stFilename
    IXP.SaveFile
End Sub
Private Sub PopulateDocumentType()
Dim c As TrueDBList80.Column
Dim stcmbFileType As String
    CleanUp
    stconn.Open DocumentLogin.stConnection
    Set cmdDocumentType.ActiveConnection = stconn
   
    stcmbFileType = cmbFileType.Text
    Select Case stcmbFileType
            Case "Part"
                stFileType = "Part"
                lstItemData.Width = 4455
                If stCurrentListState <> "Part" Then
                    If lstItemData.Columns.Count = 3 Then
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 4 Then
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 5 Then
                        lstItemData.Columns.Remove (4)
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                End If
                stCurrentListState = "Part"
                lstItemData.Columns(0).Caption = "Part Number"
                lstItemData.Columns(0).Width = 3050
                lstItemData.Columns(1).Caption = "New Seq"
                lstItemData.Columns(1).Width = 1200
                lblItemData.Caption = "Part Number:"
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'Part')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "Job"
                lstItemData.Width = 6495
                stFileType = "Job"
                If stCurrentListState <> "Job" Then
                    If lstItemData.Columns.Count = 2 Then
                        Set c = lstItemData.Columns.Add(2)
                        With c
                            .Visible = True        ' Make it visible
                            .Caption = "Part Number"
                            .Width = 3000
                        End With
                    End If
                    If lstItemData.Columns.Count = 4 Then
                        lstItemData.Columns.Remove (3)
                    End If
                    If lstItemData.Columns.Count = 5 Then
                        lstItemData.Columns.Remove (4)
                        lstItemData.Columns.Remove (3)
                    End If
                End If
                stCurrentListState = "Job"
                lstItemData.Columns(0).Caption = "Job Number"
                lstItemData.Columns(0).Width = 1750
                lstItemData.Columns(1).Caption = "New Seq"
                lstItemData.Columns(1).Width = 1200
                lstItemData.Columns(2).Caption = "Part Number"
                lstItemData.Columns(2).Width = 3000
                lblItemData.Caption = "Job Number:"
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'Job')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "Sales Order"
                stFileType = "SO"
                If stCurrentListState <> "SO" Then
                    lstItemData.Width = 6495
                    If lstItemData.Columns.Count = 2 Then
                        Set c = lstItemData.Columns.Add(2)
                        With c
                            .Visible = True        ' Make it visible
                            .Caption = "Part Number"
                            .Width = 3000
                        End With
                        Set c = lstItemData.Columns.Add(3)
                        With c
                            .Visible = False        ' Make it visible
                            .Caption = "Part Number"
                            .Width = 3000
                        End With
                    End If
                    If lstItemData.Columns.Count = 3 Then
                        Set c = lstItemData.Columns.Add(3)
                        With c
                            .Visible = False        ' Make it visible
                            .Caption = "Part Number"
                            .Width = 3000
                        End With
                    End If
                    If lstItemData.Columns.Count = 5 Then
                        lstItemData.Columns.Remove (4)
                    End If
                End If
                stCurrentListState = "SO"
                lstItemData.Columns(0).Caption = "Sales Order"
                lstItemData.Columns(0).Width = 1750
                lstItemData.Columns(1).Caption = "New Seq"
                lstItemData.Columns(1).Width = 1200
                lstItemData.Columns(2).Caption = "Customer"
                lstItemData.Columns(2).Width = 3000
                lstItemData.Columns(3).Caption = "Customer Num"
                lstItemData.Columns(3).Visible = False
                rsPath.Filter = "Filetype='SO'"
                lblItemData.Caption = "Sales Order:"
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'SO')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "RMA"
                stFileType = "RMA"
                If stCurrentListState <> "RMA" Then
                    If lstItemData.Columns.Count = 3 Then
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 4 Then
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 5 Then
                        lstItemData.Columns.Remove (4)
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                End If
                stCurrentListState = "RMA"
                lstItemData.Columns(0).Caption = "RMA Number"
                lstItemData.Columns(0).Width = 3050
                lstItemData.Columns(1).Caption = "New Seq"
                lstItemData.Columns(1).Width = 1200
                rsPath.Filter = "Filetype='RMA'"
                lblItemData.Caption = "RMA Number:"
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'RMA')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "Customer"
                stFileType = "Customer"
                If stCurrentListState <> "Customer" Then
                    If lstItemData.Columns.Count = 3 Then
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 4 Then
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                    If lstItemData.Columns.Count = 5 Then
                        lstItemData.Columns.Remove (4)
                        lstItemData.Columns.Remove (3)
                        lstItemData.Columns.Remove (2)
                    End If
                End If
                stCurrentListState = "Customer"
                lstItemData.Columns(0).Caption = "Customer"
                lstItemData.Columns(0).Width = 3050
                lstItemData.Columns(1).Caption = "New Seq"
                lstItemData.Columns(1).Width = 1200
                rsPath.Filter = "Filetype='Customer'"
                lblItemData.Caption = "Customer"
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'Customer')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
                Exit Sub
                stFileType = "Customer"
                rsPath.Filter = "Filetype='Customer'"
                lblItemData.Caption = "Customer:"
                CopyToData.RecordSource = "SELECT name, custnum From PUB_Customer ORDER BY name"
                CopyToData.Refresh
                'txtItemData.ListField = "name"
                'txtItemData.BoundColumn = "CustNum"
                cmbDocumentType.Text = DocTypeDefault.Text
                cmdDocumentType.CommandText = "SELECT  DocType.DocumentType FROM DocType WHERE (((FileType)='SO')) UNION SELECT  DocumentType FROM DocType WHERE (((FileType)='Customer'))"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "Vendor"
                stFileType = "Vendor"
                rsPath.Filter = "Filetype='Vendor'"
                lblItemData.Caption = "Vendor:"
                CopyToData.RecordSource = "SELECT name, Vendornum From PUB_Vendor ORDER BY name"
                CopyToData.Refresh
                'txtItemData.ListField = "name"
                'txtItemData.BoundColumn = "VendorNum"
                cmbDocumentType.Text = DocTypeDefault.Text
                cmdDocumentType.CommandText = "SELECT DocType.DocumentType FROM DocType WHERE (((FileType)='Vendor')) UNION SELECT  DocumentType FROM DocType WHERE (((FileType)='PO'))"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "PO Number"
                stFileType = "PO"
                rsPath.Filter = "Filetype='PO'"
                lblItemData.Caption = "PO Number:"
                CopyToData.RecordSource = "SELECT PONum FROM PUB_POHead ORDER BY PONum"
                CopyToData.Refresh
                'txtItemData.ListField = "PONum"
                cmbDocumentType.Text = DocTypeDefault.Text
                cmdDocumentType.CommandText = "SELECT DocumentType,OrderSeq From DocType Where (FileType = 'Vendor')ORDER BY OrderSeq"
                rsDocumentType.Sort = "DocumentType"
                cmbDocumentType.Clear
                rsDocumentType.CursorLocation = adUseClient
                rsDocumentType.Open cmdDocumentType, , adOpenStatic, adLockReadOnly
                rsDocumentType.MoveFirst
                Do While Not rsDocumentType.EOF
                    cmbDocumentType.AddItem (rsDocumentType.Fields("DocumentType"))
                    rsDocumentType.MoveNext
                Loop
                rsDocumentType.Close
            Case "Other"
                stFileType = "Other"
                rsPath.Filter = "Filetype='Other'"
                'txtItemData.ListField = "Other"
                lblItemData.Caption = "Other:"
                CopyToData.RecordSource = "SELECT  DocumentType FROM DocType WHERE  (FileType = N'Other') GROUP BY DocumentType ORDER BY DocumentType"
                CopyToData.Refresh
        End Select
        cmbDocumentType.Text = cmbDocumentType.Columns.Item(0)
        cmbDocumentType.Columns(1).Visible = False
        cmbDocumentType.AlternatingRowStyle = True
End Sub
Private Sub GetDocSeq()
    intDocSeq = 0
    CleanUp
    stconn.Open DocumentLogin.stConnection
    Set cmdDocSeq.ActiveConnection = stconn
    Select Case stFileType
        Case "Part"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, PartNumber, FileType From Documents GROUP BY PartNumber, FileType HAVING (PartNumber = '" & txtItemData.Text & "') AND (FileType = 'Part')"
        Case "Job"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, JobNumber, FileType From Documents GROUP BY JobNumber, FileType HAVING (JobNumber = '" & txtItemData.Text & "') AND (FileType = 'Job')"
        Case "SO"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, SalesOrderNumber, FileType From Documents GROUP BY SalesOrderNumber, FileType HAVING (SalesOrderNumber = '" & txtItemData.Text & "') AND (FileType = 'SO')"
        Case "RMA"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, RMANumber, FileType From Documents GROUP BY RMANumber, FileType HAVING (RMANumber = '" & txtItemData.Text & "') AND (FileType = 'RMA')"
        Case "Customer"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, CustomerNumber, FileType From Documents GROUP BY SalesOrderNumber, FileType HAVING (SalesOrderNumber = '" & txtItemData.Text & "') AND (FileType = 'SO')"
        Case "Vendor"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, VendorNumber, FileType From Documents GROUP BY VendorNumber, FileType HAVING (VendorNumber = '" & txtItemData.Text & "') AND (FileType = 'Vendor')"
        Case "PO"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, PONumber, FileType From Documents GROUP BY PONumber, FileType HAVING (PONumber = '" & txtItemData.Text & "') AND (FileType = 'PO')"
        Case "AP"
            cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, APNumber, FileType From Documents GROUP BY APNumber, FileType HAVING (APNumber = '" & txtItemData.Text & "') AND (FileType = 'AP')"
        Case "Other"
            'FIX cmdDocSeq.CommandText = "SELECT MAX (DocumentSeq) AS DocSeq, SalesOrderNumber, FileType From Documents GROUP BY SalesOrderNumber, FileType HAVING (SalesOrderNumber = '" & txtItemData.Text & "') AND (FileType = 'SO')"
    End Select
    rsDocSeq.CursorLocation = adUseClient
    rsDocSeq.Open cmdDocSeq, , adOpenStatic, adLockReadOnly
    If rsDocSeq.RecordCount = 0 Then
        intDocSeq = 1
    Else
        intDocSeq = rsDocSeq.Fields("DocSeq").Value + 1
    End If
End Sub
Private Sub CleanUp()
    If stconn.State = 1 Then
        stconn.Close
    End If
End Sub
Private Sub ValidateItemData()
    CleanUp
    stconn.Open DocumentLogin.stConnection
    Set cmdItemData.ActiveConnection = stconn
    Select Case stFileType
        Case "Part"
            cmdItemData.CommandText = "Select Partnum from Pub_Part where PartNum ='" & txtItemData.Text & "'"
        Case "Job"
            cmdItemData.CommandText = "Select Jobnum, PartNum from Pub_JobHead where JobNum ='" & txtItemData.Text & "'"
        Case "SO"
            cmdItemData.CommandText = "Select OrderNum, PUB_OrderHed.CustNum, Name FROM PUB_OrderHed INNER JOIN PUB_Customer ON PUB_OrderHed.CustNum = PUB_Customer.Custnum where OrderNum ='" & txtItemData.Text & "'"
        Case "RMA"
            cmdItemData.CommandText = "Select RMANum FROM PUB_RMAHead where RMANum='" & txtItemData.Text & "'"
        Case "Customer"
            cmdItemData.CommandText = "Select Custnum, Name FROM PUB_Customer where Custnum='" & txtItemData.Text & "'"
        Case "Vendor"  'FIX Vendor Number storage?
            cmdItemData.CommandText = "Select VendorNum, PUB_OrderHed.CustNum, Name FROM PUB_OrderHed INNER JOIN PUB_Customer ON PUB_OrderHed.CustNum = PUB_Customer.Custnum where OrderNum ='" & txtItemData.Text & "'"
        Case "PO"
            cmdItemData.CommandText = "SELECT PONum, Name, PUB_POhead.Vendornum FROM PUB_POhead INNER JOIN PUB_Vendor ON PUB_POhead.Vendornum = PUB_Vendor.VendorNum where PONum ='" & txtItemData.Text & "'"
        Case "AP"
            cmdItemData.CommandText = "SELECT PUB_APInvHed.InvoiceNum, PUB_Vendor.Name, PUB_APInvHed.VendorNum FROM PUB_APInvHed INNER JOIN PUB_Vendor ON PUB_APInvHed.VendorNum = PUB_Vendor.VendorNum"
            Case "Other"
            'FIX cmdItemData.CommandText = "Select OrderNum, PUB_OrderHed.CustNum, Name FROM PUB_OrderHed INNER JOIN PUB_Customer ON PUB_OrderHed.CustNum = PUB_Customer.Custnum where OrderNum ='" & txtItemData.Text & "'"
        End Select
    rsItemData.CursorLocation = adUseClient
    rsItemData.Open cmdItemData, , adOpenStatic, adLockReadOnly
    If rsItemData.RecordCount = 0 Then
        blValid = False
    Else
        blValid = True
        Select Case stFileType
            Case "Job"
                stMisc1 = rsItemData.Fields("PartNum")
            Case "SO"
                stMisc1 = rsItemData.Fields("Name")
                stMisc2 = rsItemData.Fields("CustNum")
            Case "Customer"
                stMisc1 = rsItemData.Fields("CustNum")
            Case "Vendor"
                stMisc1 = rsItemData.Fields("VendorNum")
            Case "PO"
                stMisc1 = rsItemData.Fields("Name")
                stMisc2 = rsItemData.Fields("VendorNum")
            Case "AP"
                stMisc1 = rsItemData.Fields("Name")
                stMisc2 = rsItemData.Fields("VendorNum")
            Case "Other"
                'FIX
        End Select
    End If
CleanUp
End Sub
Public Sub AddItem()
    If txtItemData.Text = "" Then
        Exit Sub
    End If
    Dim bk As Variant 'This section checks to see if the item is already been selected.
    bk = lstItemData.Columns(CInt(0)).Find(CStr(txtItemData.Text), dblSeekEQ, False)
    If Not IsNull(bk) Then
        temp = MsgBox(txtItemData.Text & " is already in the list")
        Exit Sub
    End If
    ValidateItemData 'Make sure this is a valid item number
    If blValid = False Then
        temp = MsgBox(txtItemData.Text & " is not a valid Item.")
        Exit Sub
    End If
    GetDocSeq        'Get the next available document seq number
    Select Case stFileType
        Case "Part"
            temp = txtItemData & ";" & intDocSeq
        Case "Job"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1
        Case "SO"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "RMA"
            temp = txtItemData & ";" & intDocSeq
        Case "Customer"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "Vendor"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "PO"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "AP"
            temp = txtItemData & ";" & intDocSeq & ";" & stMisc1 & ";" & stMisc2
        Case "Other"
            'FIX
        End Select
       
    lstItemData.AddItem temp, 0
   'This section checks to see if the item is already been added to history.
    bk = lstItemDataHistory.Columns(CInt(0)).Find(CStr(txtItemData.Text), dblSeekEQ, False)
   
    If Not IsNull(bk) Then
    Else
        lstItemDataHistory.AddItem txtItemData.Text
    End If
    txtItemData.Text = ""
    cmbDocumentType.Enabled = True
    txtDescription.Enabled = True
    cmbDocumentType.BackColor = &H80000005
    txtDescription.BackColor = &H80000005
    btnFileSearch.Enabled = True
    btnRemove.Enabled = True
    btnMemo.Enabled = True
    If stMode = "SCAN" Then
        btnSave.Enabled = True
    End If
         
End Sub

Private Sub GetFileTypePath()
    CleanUp
    stconn.Open DocumentLogin.stConnection
    Set cmdPath.ActiveConnection = stconn
    cmdPath.CommandText = "SELECT * from pathmaint where Filetype='" & stFileType & "'"
    rsPath.CursorLocation = adUseClient
    rsPath.Open cmdPath, , adOpenStatic, adLockReadOnly
    stpath = rsPath.Fields("Path")
    CleanUp
End Sub
0
chrisryhal
Asked:
chrisryhal
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
fds_fatboyCommented:
At a guess you are missing the TrueOleDBList80 DLL/OCX  from the package.
0
 
JohnBPriceCommented:
You probably get this problem at project load time?  You need to have the TrueGrid components installed & licensed on your build machine.
0
 
DabasCommented:
Hi chrisryhal:
Check Project->References.
You probably have a missing reference there.


Dabas
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
chrisryhalAuthor Commented:
I am confirmed that it is selected in the references
0
 
chrisryhalAuthor Commented:
The controls are loaded and installed for development purposes
0
 
JohnBPriceCommented:
Those controls should be under components as well as references.  Select it in the components and note the file name that it is looking for.  Is it marked as "missing"?  If not, check that you actually have the file in the right place.  Try creating a brand new project, add those components and drop them on a form.  Do you get any errors?  If not, look at them in the components page of the new project.  Are they given as the same file in the same directory?
0
 
chrisryhalAuthor Commented:
If only I could get you the source to review.  Is that allowed on here, to ZIP it up and make available via download?
0
 
JohnBPriceCommented:
Generally, no.  It might not help anyway unless someone has truegrid objects.

You can, however, open your .vbp with notepad (it is just text) and post that text.  It might give someone an idea.

Did you try my tests?  With what results?
0
 
chrisryhalAuthor Commented:
.VBP with Notepad.

The text worked JohnBPrice.  I know the application works, because its being used in production, and this is source.  Just can't find the original developer.



Type=Exe
Object={27F9C463-0196-11D5-8C18-00A0CC3EC8E6}#1.0#0; notexp60.dll
Object={4BD5A3A1-7FFE-11D4-A13A-004005FA6275}#1.0#0; ImagXpr6.dll
Object={9841D1A1-9C0B-11D3-9452-00105A098C21}#1.0#0; PrntPRO2.dll
Reference=*\G{00062FFF-0000-0000-C000-000000000046}#9.0#0#..\..\..\..\..\PROGRA~1\MICROS~3\Office\msoutl9.olb#Microsoft Outlook 9.0 Object Library
Reference=*\G{00000205-0000-0010-8000-00AA006D2EA4}#2.5#0#..\..\..\..\..\Program Files\Common Files\system\ado\msado25.tlb#Microsoft ActiveX Data Objects 2.0 Library
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\WINNT\system32\stdole2.tlb#OLE Automation
Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\..\..\..\WINNT\system32\MSSTDFMT.DLL#Microsoft Data Formatting Object Library
Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\..\..\..\WINNT\system32\MSBIND.DLL#Microsoft Data Binding Collection
Reference=*\G{1C81E0B1-BFC2-42C4-A910-97E0FA9F83C9}#1.0#0#..\..\..\..\..\WINNT\system32\vsstr8.ocx#ComponentOne VSFlexString 8.0
Object={1C81E0B1-BFC2-42C4-A910-97E0FA9F83C9}#1.0#0; vsstr8.ocx
Object={C115893A-A3BF-43AF-B28D-69DB846077F3}#1.0#0; vsflex8u.ocx
Object={FAD0952A-804F-4061-84BA-88D0F2AA07A8}#1.0#0; vsflex8d.ocx
Object={BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0; vsflex8.ocx
Object={82392BA0-C18D-11D2-B0EA-00A024695830}#1.0#0; ticaldr8.ocx
Reference=*\G{C10EF3FA-DEBF-4189-8859-C35CA400BBA8}#8.0#0#..\..\..\..\..\WINNT\system32\xadb8.ocx#ComponentOne XArrayDB 8.0 Object
Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX
Object={F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0; MSDATLST.OCX
Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; MSDATGRD.OCX
Object={0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0; MSHFLXGD.OCX
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx
Object={60CCE6A8-5C61-4F30-8513-F57EED62E86A}#8.0#0; todl8.ocx
Object={20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0; MSMAPI32.OCX
Object={8767A745-088E-4CA6-8594-073D6D2DE57A}#9.2#0; crviewer9.dll
Reference=*\G{AF376990-6120-4E28-96DD-63FD2DC27B7A}#9.0#0#..\..\..\..\..\Program Files\Common Files\Crystal Decisions\2.0\bin\craxdrt9.dll#Crystal Reports 9 ActiveX Designer Run Time Library
Reference=*\G{2B78E590-E7D0-49BF-8F16-CFD6324DB307}#9.0#0#..\..\..\..\..\Program Files\Common Files\Crystal Decisions\2.0\bin\craxddrt9.dll#Crystal Reports 9 ActiveX Designer Design and Runtime Library
Form=DocumentEdit.frm
Form=About.frm
Form=DocumentTracker.frm
Form=DocumentViewer.frm
Module=Module1; Module1.bas
Form=DocumentLogin.frm
Form=DocumentCopy.frm
Form=DocumentVendorAdd.frm
Form=DocumentAttach.frm
Form=DocumentMemo.frm
Form=DocumentItemLookup.frm
Designer=CrystalReport1.Dsr
Form=DocumentCrystalForm.frm
Object={89F92CAF-B12C-4D3B-B92B-F75DDAB357B6}#1.0#0; PrintPRO3.dll
IconForm="DocumentLogin"
Startup="DocumentLogin"
HelpFile=""
Title="Document Tracker"
ExeName32="DocumentTracker.exe"
Command32=""
Name="DocumentTrackerProject"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="PROTOPORIA"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0

[MS Transaction Server]
AutoRefresh=1
0
 
DabasCommented:
chrisryhal:
> If only I could get you the source to review
You ARE allowed to place the the source on a website or an ftp site that is equally available to all members that read this question

I wonder if we are barking up the right tree here, and find it difficult to reconcile the code you have given us with the source of the problem.

For example,
Line 17: Class TrueOleDBList80.TDBCombo of control cmbDocumentType was not a loaded control class.

but the 17th line of the code you sent does not have a cmbDocumentType. (Nor anywhere near it). Similar with the other lines that produce the error. I guess this is because VB6 does not expose quite a lot of declarations that are in the .frm file.
It will help if you open your frm file in notepad, and post here the contents of lines 17, 166, 323, 480.

My guess is that the problem relies on your system not having the same version of TrueDBList as the original programmer. Probably one is the MS version, while the other is an upgrade by Sheridan. I had a similar issue with my programs once.

In your last post I also do not see a reference to TrueOleDBList80, which makes it hard to identify which reference is the cause of your headaches. I assume it is
Reference=*\G{C10EF3FA-DEBF-4189-8859-C35CA400BBA8}#8.0#0#..\..\..\..\..\WINNT\system32\xadb8.ocx#ComponentOne XArrayDB 8.0 Object
Have a look at xadb8.ocx in your system folder to see if you can find any version information and if its GUI matches the one stated here.

Good luck!

Dabas
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now