Abe, you should know by now that you can not just ask for code, show your efforts first.:)

Option Explicit

Dim oConn As ADODB.Connection
Dim oRs As ADODB.Recordset

Private Sub Command2_Click()

    'Using MS Access database...
    Dim sConn As String
    Dim oConn As New ADODB.Connection 'Declare a new connection...
    Dim oRs As New ADODB.Recordset 'Declare a new recordset...
    sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\YourDatabaseNameHere.MDB;Persist Security Info=False"
    oConn.Open sConn
    oRs.Open "SELECT * FROM YourTableNameHere", oConn, adOpenStatic, adLockOptimistic
    Dim xAdd As Integer

For xAdd = 0 To oRs.Recordcount - 1
cbodept.AddItem oRs.Office
Next xAdd
End If
End Sub

I cant really have a code for that sir, its my first time to deal with this kind of prob.

I am use in entering values on comboboxes manually, writing values on the property list.

I'll try your code and get back if i have more further question.

It Works sir.

Just have to add some Declarations and modifications. :)


This question has already been answered. Start a new discussion instead.