I would like to build a query in VBA that uses a text string criteria given in a combo box yet if the combo box is empty gives all records.
I realise that i could use an if statement and write two different querydefs but there are 4 combo boxes and so the combinations are numerous.
Below is the code that builds the query that selects the records that correspond to what is entered into the combo box. What i would like to know is what to add to this code to get all records if the combo box is empty.
Thanks very much
Dim db As Database
Dim rs As Recordset
Dim qry As QueryDef
Dim strSql As String
Dim strCode, strAdd, strPostcode, strName As String