Adding Records To A Listview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    Adding Records To A Listview

    I Have A Form (frmLoan) With Loan Details And I Have Made Another Form(frmLoanSum mary)

    In the frmLoanSummary I have Placed A Listview On It. How Can I get the information off of the (frmLoan) To appear in the listview.

    Can Someone show me....

    The Code I have for frmLoan

    Code:
        Private Con As New ADODB.Connection
        Private Rec As New ADODB.Recordset
    Private Sub cmdAdd_Click()
        AddNewLoan
        txtLoanID.SetFocus
    End Sub
    Private Sub cmdEnter_Click()
        UpdateRecords
    End Sub
    Private Sub cmdNext_Click()
        Rec.MoveNext
        Call LoadTextboxes
    End Sub
    Private Sub cmdPrevious_Click()
        Rec.MovePrevious
        Call LoadTextboxes
    End Sub
    Private Sub Form_Load()
        ConnectToDatabase
    End Sub
    Private Sub mnuSummary_Click()
        frmLoanSummary.Show
        Unload Me
    End Sub
    Private Sub LoadTextboxes()
        On Error Resume Next
        txtLoanID = Rec("loanID")
        txtLoaner = Rec("loanersname")
        txtAmountOfLoan = Rec("AmountOFLoan")
        txtPaymentOf = Rec("paymentof")
        txtDescriptionOfLoan = Rec("description")
        txtDateMailed = Rec("datemailed")
        txtPaymentType = Rec("paymenttype")
        txtLoanBalance = Rec("LoanBalance")
        txtReferenceNumber = Rec("referencenumber")
        txtLoanBalance = txtAmountOfLoan - txtPaymentOf
        Label6.Caption = "Left On The Loan"
        TextBoxCurrency
        TextFontSizeAndColor
    End Sub
    Private Sub TextBoxCurrency()
        txtAmountOfLoan = FormatCurrency(txtAmountOfLoan)
        txtLoanBalance = FormatCurrency(txtLoanBalance)
        txtPaymentOf = FormatCurrency(txtPaymentOf)
    End Sub
    Private Sub TextFontSizeAndColor()
        txtLoanBalance.FontBold = True
        txtLoanBalance.ForeColor = vbRed
    End Sub
    Private Sub ConnectToDatabase()
        Con.Provider = "Microsoft.jet.oledb.4.0; "
        Con.Open "C:\LoanInformation.mdb"
        Rec.Open "Select * From LoanT", Con, adOpenDynamic, adLockOptimistic
        Call LoadTextboxes
    End Sub
    Private Sub AddNewLoan()
        Rec.AddNew
        txtLoanID = vbNullString
        txtLoaner = vbNullString
        txtAmountOfLoan = vbNullString
        txtPaymentOf = vbNullString
        txtDescriptionOfLoan = vbNullString
        txtDateMailed = vbNullString
        txtPaymentType = vbNullString
        txtLoanBalance = vbNullString
        txtReferenceNumber = vbNullString
        txtLoanBalance = vbNullString
    End Sub
    Private Sub UpdateRecords()
        Rec.Update
        Rec("loanid") = txtLoanID
        Rec("loanersname") = txtLoaner
        Rec("Amountofloan") = txtAmountOfLoan
        Rec("paymentof") = txtPaymentOf
        Rec("description") = txtDescriptionOfLoan
        Rec("DateMailed") = txtDateMailed
        Rec("paymenttype") = txtPaymentType
        Rec("loanbalance") = txtLoanBalance
        Rec("referencenumber") = txtReferenceNumber
    End Sub
    
    Private Sub txtPaymentOf_LostFocus()
        Call LoadTextboxes
    End Sub
    How Can I do This With a ADODC Recordset

    lee123
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    C'mon

    How Is Anyone Suppose to learn how to do this stuff if no one is willing to share there Thoughts and Knowledge about things like this, I have some books on this but they only talk about this with a Treeview and i don't want to use a tree view......so C'mon lend a hand with this will ya!

    lee123

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      The following link might help you.

      Link.

      Comment

      Working...