Hello, I need to populate a Access 2003 form combo box with the following VBA code using ADODB:
Dim SQLa As String: Dim rs As ADODB.Recordset: Dim cn As ADODB.Connection: Set cn = New ADODB.Connection
cn.Open "driver={SQL Server};server=mxbarzcpms001;database=mwo;Trusted_Connection=Yes"
SQLa = "select work_order_number from mwo.dbo.mwo
where ((manager = 'Mike Smith') and (manager_status is null)) or ((manager = 'Mike Smith') and (manager_status = 'Hold'))"
Set rs = cn.Execute(SQLa, , adCmdText)
This query works fine and returns the data I need but I am not sure how to pass it to the form combo box.
Thanks for any and all help and suggestions
Dim SQLa As String: Dim rs As ADODB.Recordset: Dim cn As ADODB.Connection: Set cn = New ADODB.Connection
cn.Open "driver={SQL Server};server=mxbarzcpms001;database=mwo;Trusted_Connection=Yes"
SQLa = "select work_order_number from mwo.dbo.mwo
where ((manager = 'Mike Smith') and (manager_status is null)) or ((manager = 'Mike Smith') and (manager_status = 'Hold'))"
Set rs = cn.Execute(SQLa, , adCmdText)
This query works fine and returns the data I need but I am not sure how to pass it to the form combo box.
Thanks for any and all help and suggestions