Hi All,
I am trying to populate a 2 column combobox with the content of a record from a recordset. The user selects the relevant button on a sub form and the main form populates with the selection. For some reason I keep betting errors and I just don't know why. Can anyone help the debugger falls over on the line where I'm trying to display the contents of the recordset.
Any help would be gratefully received!!
Zar!
I am trying to populate a 2 column combobox with the content of a record from a recordset. The user selects the relevant button on a sub form and the main form populates with the selection. For some reason I keep betting errors and I just don't know why. Can anyone help the debugger falls over on the line where I'm trying to display the contents of the recordset.
Code:
Private Sub btnSelectSlot_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set db = CurrentDb
strSQL = "select * from tblSiteDeploymentSlots where deploymentslotid = " & Me.txtDeploymentSlotID & ";"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
Forms!frmAssignDeploymentSlotToSite.cbxCodeName.Column(1) = Left(rs![Site Name], 5)
Set rs = Nothing
Set db = Nothing
End Sub
Any help would be gratefully received!!
Zar!