I'm using the following VBA to populate my combobox.
The problem is that for whatever reason the stored procedure simply won't return the data sorted the way I want it.
Any way to do that in the VBA below? It would be by ID desc
Private Sub cmbVisits_GotFocus()
cmbVisits.RowSource = ""
Dim cmd1 As New ADODB.Command
Dim rst1 As ADODB.Recordset
'Connect to db and run stored proc based on Client ID
cmd1.ActiveConnection = CurrentProject.Connection
cmd1.CommandType = adCmdStoredProc
cmd1.CommandText = "usp_MarketingClientVisitsGet"
cmd1.Parameters("@ClientID") = Me.txtClientID.Value
'Set the recordset
Set rst1 = cmd1.Execute()
If rst1.RecordCount > 0 Then
.RowSourceType = "Value List"
.BoundColumn = 1
.ColumnCount = 2
.ColumnWidths = "0;1.5in"
.ColumnHeads = False
Do Until .EOF
cmbVisits.AddItem !ID & ";" & !AE