I've got a form with unbound fields called O, C, JT, SL, SH, D1 and D2. what I'm trying to do is let users choose 1 or more records to serach on, which I've managed to do with
DoCmd.OpenReport "External Post Ads", acViewPreview, , "[Ad_Date] BETWEEN #" & Format$(Me![d1], "yyyy-mm-dd") & "# AND #" & Format$(Me![d2], "yyyy-mm-dd") & "# and [Organisation] Like '*" & Me.[O] & "*' and [Job_Title] Like '*" & Me.[JT] & "*' and [contract] Like '*" & Me.[C] & "*' AND [Salary_Range_low] >= '" & Me.[sl] & "' or [Salary_Range_HIGH] <= '" & Me.[sh] & "'", acWindowNormal
What I'm having problem with is if they do not enter any information on the form and press the search button i want the report to show all records but all I'm getting at the moment is a blank report even though I've got data in the table.
Can anyone help me its driving me mad.
DoCmd.OpenReport "External Post Ads", acViewPreview, , "[Ad_Date] BETWEEN #" & Format$(Me![d1], "yyyy-mm-dd") & "# AND #" & Format$(Me![d2], "yyyy-mm-dd") & "# and [Organisation] Like '*" & Me.[O] & "*' and [Job_Title] Like '*" & Me.[JT] & "*' and [contract] Like '*" & Me.[C] & "*' AND [Salary_Range_low] >= '" & Me.[sl] & "' or [Salary_Range_HIGH] <= '" & Me.[sh] & "'", acWindowNormal
What I'm having problem with is if they do not enter any information on the form and press the search button i want the report to show all records but all I'm getting at the moment is a blank report even though I've got data in the table.
Can anyone help me its driving me mad.