My wish list would be to create a recordset based on three parameters from three text fields on a form, and populate a combo box (or similar if you know of a better way) with the returned recordset.
I can create the recordset based on the three parameters but I have encountered the following problems.
1. I want the recordset to be returned if less then the three parameters are completed.
2. When I try to populate the combo box at the moment I keep getting the error message
Run Time Error '451'
Property let Procedure not defined and property get procedure did not return an objectOption Compare Database
I have enclosed a cut down version of the code I am currently using (only one parameter)
Dim db As Database, strSearch As String, rstSearch As Recordset
Many Thanks for any help.
I can create the recordset based on the three parameters but I have encountered the following problems.
1. I want the recordset to be returned if less then the three parameters are completed.
2. When I try to populate the combo box at the moment I keep getting the error message
Run Time Error '451'
Property let Procedure not defined and property get procedure did not return an objectOption Compare Database
I have enclosed a cut down version of the code I am currently using (only one parameter)
Dim db As Database, strSearch As String, rstSearch As Recordset
Code:
Private Sub cmdSearch_Click()
Set db = CurrentDb()
strSearch = "SELECT tblClaimants.Surname FROM tblClaimants WHERE tblClaimants.Surname = '" & Forms!frmSearch!txtSurname & "'"
Set rstSearch = db.OpenRecordset(strSearch)
Me!cboSearch.Column(0) = rstSearch.Fields(0)
rstSearch.Close
db.Close
End Sub