I want to populate a list box using the criteria contained in a combo box on the same form. I'm using DLookUp to get the data from a query. The code is shown below:
Private Sub cboServerNm_LostFocus()
Dim ServNmQry As String
If Not IsNull(cboServerNm) Then
ServNmQry = DLookup("[Description]", "qryServerToService", "[Name] = " & Me.cboServerNm)
Me.lstServices = ServNmQry
End If
End Sub
it gives the following error: Run-time error '2471' The expression you entered as a query parameter produced this error: 'Adder'
'Adder' is the name of the server in the combo box.
How can I get the name of the service into the list box?