Results 1 to 20 of 20

Thread: [RESOLVED] Add code to existing: Populate combobox from database

Threaded View

  1. #15

    Thread Starter
    Lively Member
    Join Date
    Jun 2013
    Posts
    100

    Re: Add code to existing: Populate combobox from database

    Good morning doogle,
    I am attempting to take the listview items that were loaded, like in these examples (there are more, just wanted to provide a smaller example):

    Code:
     lvwItem.SubItems(1) = oRS.Fields.Item("Loan_Number").Value & ""
       lvwItem.SubItems(2) = oRS.Fields.Item("Investor").Value & ""
       lvwItem.SubItems(3) = oRS.Fields.Item("State").Value & ""
       lvwItem.SubItems(4) = oRS.Fields.Item("Doc_Type").Value & ""
    And place them in textboxes or combo boxes. The user will select the row, and click a command button that runs the below.

    I am using the below
    Code:
    Private Sub cmdSelect_Click()
    txtLoanNumber.Text = ListView1.SelectedItem.SubItems(1)
    cboInvestor.Text = ListView1.SelectedItem.SubItems(2)
    cboState.Text = ListView1.SelectedItem.SubItems(3)
    cboDocType.Text = ListView1.SelectedItem.SubItems(4)
    end sub
    However if the combo boxes (cbo) are set to 2-Drop down list, AND the field is blank on the database, i receive the read only error. However If i change it to 0-drop down combo. I would like to keep it as 2-drop down list and create a workaround if blank. But if that's not possible i understand.

    I attempted the above and I still receive the same error.

    Thoughts?
    Last edited by MWhiteDesigns; Jun 19th, 2013 at 07:26 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width