May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.
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 With Me.cmbVisits .RowSourceType = "Value List" .BoundColumn = 1 .ColumnCount = 2 .ColumnWidths = "0;1.5in" .ColumnHeads = False End With With rst1 .MoveFirst Do Until .EOF cmbVisits.AddItem !ID & ";" & !AE .MoveNext Loop End With End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.