views:

160

answers:

1

A runtime error of 3709 keeps popping up when I run this part of the program. Does anyone know what I can do to fix it?

Public cn As New ADODB.Connection

Public rs As New ADODB.Recordset

Public CustomerID As Integer

Public CustFirstName As String

Public CustLastName As String


Sub GetCustomerList()

    Dim strSQL As String
    Dim Customers As Variant

    ' Import customer info and use it to populate the list box.
    ' After frmcustomers is unloaded, we will know the CustomerID
    ' and Customer Name of the selected order.

    strSQL = "SELECT CustomerID, CustFirstName, CustLastName FROM Customers"
    rs.Open strSQL, cn

    frmCustomers.Show

    rs.Close
End Sub

Thanks,

JM

A: 

From the error you are reporting, it would seem that at the point you call GetCustomerList() the connection is not open.

Mitch Wheat