Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006

    Unanswered: How to load Employee names into A Combo Box

    I am developing a Payroll Program. I have created a Database Table in Ms Access 2000. I have placed Text Box controls on my Vb 6 Form including a Combo box.
    I want to fill the combo box with employee names when the Form loads. I have tried to write codes that will do this, but can't get it done.

    Please kindly assist me. What is wrong with the following codes?:
    Private Sub Form_Load()
    With adoSubjects.Recordset
        Do Until Not .EOF
            If !SubjectCode <> "" Then
            cboSubjects.AddItem !SubjectCode
            End If
    End With
    Last edited by loquin; 02-19-07 at 15:24.

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    I assume that you didn't get the End Sub when you copied from your app.

    Now, I don't see the code where you declare and load the recordset. What does that look like?
    ...but can't get it done.

    ... What is wrong with the following codes?:
    You don't specify what is, (or isn't) happening?

    Are getting ANY values in the combo box?

    Have you stepped through this code? Add a breakpoint to it, and run the app. When execution stops at the breakpoint, step through it, using the F8 key. At any time, pause the cursor over a variable or object property to see the value contained within displayed in a tooltip.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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