Can anyone help please?
I have a search form that passes 4 parameterers to a query.
In the query builder it reads:
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
>=[FORMS].[frmCourseSearch].[txtStartDate]
<=[FORMS].[frmCourseSearch].[txtEndDate]
[FORMS].[frmCourseSearch].[txtCourseID]
This works fine. But I also want it to search on only 1 or 2 parameters and set the rest to Null so I have used this statement for each one.
Like [FORMS].[frmCourseSearch].[txtCourse] & "*" OR Like [FORMS].[frmCourseSearch].[txtCourse] & "*" Is Null
This again works ok and I can search on any parameter. However, every time I enter data into the search form and run the query it repeats the query string in the query builder. i.e
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
etc...
It does this with all 4 parameters and it's starting to look very messy. The SQL view is the same with a new repeated line added each time I run the query.
How do I stop this happening?
Thanks in advance.
I have a search form that passes 4 parameterers to a query.
In the query builder it reads:
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
>=[FORMS].[frmCourseSearch].[txtStartDate]
<=[FORMS].[frmCourseSearch].[txtEndDate]
[FORMS].[frmCourseSearch].[txtCourseID]
This works fine. But I also want it to search on only 1 or 2 parameters and set the rest to Null so I have used this statement for each one.
Like [FORMS].[frmCourseSearch].[txtCourse] & "*" OR Like [FORMS].[frmCourseSearch].[txtCourse] & "*" Is Null
This again works ok and I can search on any parameter. However, every time I enter data into the search form and run the query it repeats the query string in the query builder. i.e
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
Like [FORMS].[frmCourseSearch].[txtCourse] & "*"
etc...
It does this with all 4 parameters and it's starting to look very messy. The SQL view is the same with a new repeated line added each time I run the query.
How do I stop this happening?
Thanks in advance.
Last edited: