Hi,
I have a rather strange problem that I've been racking my brain on for about 3 hours now. I've checked the knowledgebase, and didn't return anything helpful.
I have a client with an Access 2000 database that's connected to a remote SQL server on the other side of the country. Because of the slowness of getting the data, several of the data forms open with a filter dialog form. I've made several of these, but one of them (just one) is having this problem.
This form (WebLinksSubform) opens with a dialog form (DialogFilterWebLinks), which has 6 controls:
txtTitleWord1
txtTitleWord2
txtTitleWord3
txtSearchWord1
txtSearchWord2
cboSelpReviewer
All of these are text controls, except cboSelpReviewer, which contains the IndividualID # of the reviewer.
Each time the dialog form opens, it resets all fields to Null in the code.
The main form is based on the following query:
SELECT WebLinks.*
FROM WebLinks LEFT JOIN Groups ON WebLinks.fkGroupID = Groups.pkGroupID
WHERE (((WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord1] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord2] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord3] & "*"
AND ((Groups.GroupName) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord1] & "*" And (Groups.GroupName) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord2] & "*"
AND ((WebLinks.fkIndividualID)=[Forms]![DialogFilterWebLinks]![cboSelpReviewer]) AND (([Forms]![DialogFilterWebLinks]![cboSelpReviewer]) Is Not Null)) OR (((WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord1] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord2] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord3] & "*"
AND ((WebLinks.fkIndividualID)=[Forms]![DialogFilterWebLinks]![cboSelpReviewer]) AND (([Forms]![DialogFilterWebLinks]![cboSelpReviewer]) Is Not Null) AND ((Groups.Acronym) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord1] & "*" And (Groups.Acronym) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord2] & "*"
) OR (((WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord1] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord2] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord3] & "*"
AND ((Groups.GroupName) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord1] & "*" And (Groups.GroupName) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord2] & "*"
AND (([Forms]![DialogFilterWebLinks]![cboSelpReviewer]) Is Null)) OR (((WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord1] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord2] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord3] & "*"
AND (([Forms]![DialogFilterWebLinks]![cboSelpReviewer]) Is Null) AND ((Groups.Acronym) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord1] & "*" And (Groups.Acronym) Like "*" & [Forms]![DialogFilterWebLinks]![txtSearchWord2] & "*"
);
Translation:
Get all WebLinks records where:
( Title contains txtTitleWord1, txtTitleWord2, and txtTitleWord3 (if any) )
AND
(( GroupName contains txtSearchWord1 and txtSearchWord2 (if any) ) OR ( GroupAcronym contains txtSearchWord1 and txtSearchWord2 (if any) ))
AND
( IndividualID equals cboSelpReviewer OR cboSelpReviewer is Null )
The filtering works just fine -- the first time. But each subsequent attempt to filter the recordset query returns a recordset that's limited not only by the new filter criteria, but the old filter criteria as well. I've tried running just this query (without the dialog form, so I'm prompted for each of the six field values), and left all parameters blank, which should return the complete recordset - but instead, it's returning just the one record that was returned when I first ran the filter today.
(Hopefully, this made sense to somebody, who will be able to tell me how to fix this
) Please let me know if there's anything that needs clarifying. Katie
I have a rather strange problem that I've been racking my brain on for about 3 hours now. I've checked the knowledgebase, and didn't return anything helpful.
I have a client with an Access 2000 database that's connected to a remote SQL server on the other side of the country. Because of the slowness of getting the data, several of the data forms open with a filter dialog form. I've made several of these, but one of them (just one) is having this problem.
This form (WebLinksSubform) opens with a dialog form (DialogFilterWebLinks), which has 6 controls:
txtTitleWord1
txtTitleWord2
txtTitleWord3
txtSearchWord1
txtSearchWord2
cboSelpReviewer
All of these are text controls, except cboSelpReviewer, which contains the IndividualID # of the reviewer.
Each time the dialog form opens, it resets all fields to Null in the code.
The main form is based on the following query:
SELECT WebLinks.*
FROM WebLinks LEFT JOIN Groups ON WebLinks.fkGroupID = Groups.pkGroupID
WHERE (((WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord1] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord2] & "*" And (WebLinks.Title) Like "*" & [Forms]![DialogFilterWebLinks]![txtTitleWord3] & "*"
Translation:
Get all WebLinks records where:
( Title contains txtTitleWord1, txtTitleWord2, and txtTitleWord3 (if any) )
AND
(( GroupName contains txtSearchWord1 and txtSearchWord2 (if any) ) OR ( GroupAcronym contains txtSearchWord1 and txtSearchWord2 (if any) ))
AND
( IndividualID equals cboSelpReviewer OR cboSelpReviewer is Null )
The filtering works just fine -- the first time. But each subsequent attempt to filter the recordset query returns a recordset that's limited not only by the new filter criteria, but the old filter criteria as well. I've tried running just this query (without the dialog form, so I'm prompted for each of the six field values), and left all parameters blank, which should return the complete recordset - but instead, it's returning just the one record that was returned when I first ran the filter today.
(Hopefully, this made sense to somebody, who will be able to tell me how to fix this