I am using the following ADO to get a ComboBox to populate and it works, but I have to use the drop down to see any of the addresses.
What I am trying to do is:
a. On current record return the value of Address_ID_1
b. On Insert or Update, provide the entire list
Currently, upon load the combobox is blank, but the drop down is populated. I would prefer to have this loaded with the current record.
Thanks in advance,
Donald
What I am trying to do is:
a. On current record return the value of Address_ID_1
b. On Insert or Update, provide the entire list
Code:
Private Sub Address_Selection()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
Set cnn = CurrentProject.AccessConnection
With cmd
.ActiveConnection = cnn
.CommandType = adCmdStoredProc
.CommandText = "sp_AddressSelection"
'.NamedParameters = True
.Parameters("@VendorID") = Me.Clinical_Site.Value
Set rs = .Execute
End With
Set Me.Address_ID_1.Recordset = rs
Set rs = Nothing
cnn.Close
End Sub
Currently, upon load the combobox is blank, but the drop down is populated. I would prefer to have this loaded with the current record.
Thanks in advance,
Donald