embed a query into a form that has the query criteria

  • Thread starter Thread starter Guest
  • Start date Start date
Dear Ember,

(Like[Forms]![frmSearch]![Field Name])
Where on earth did you get this from??

In the case of removing the "*" default values in your criteria controls
(good idea!), the two approaches I suggested were:

[Forms]![frmSearch]![Field Name] Or [Forms]![frmSearch]![Field Name]
Is Null
Like Nz([Forms]![frmSearch]![Field Name],"*")
 
I got that from the query. When I just enter [Forms]![frmSearch]![Field
Name] it adds the "Like" to the beginning of the line.

I will try your two ideas again and see if that makes a difference.

Ember

Steve Schapel said:
Dear Ember,

(Like[Forms]![frmSearch]![Field Name])
Where on earth did you get this from??

In the case of removing the "*" default values in your criteria controls
(good idea!), the two approaches I suggested were:

[Forms]![frmSearch]![Field Name] Or [Forms]![frmSearch]![Field Name]
Is Null
Like Nz([Forms]![frmSearch]![Field Name],"*")

--
Steve Schapel, Microsoft Access MVP

Okay, I deleted the query and remade it, this time adding
(Like[Forms]![frmSearch]![Field Name]) one at a time. I also took out the
"default" value of "*" out of my search criteria. It is working now. The
subform is refreshing to show all records that contain the selected criteria.

However, it only works for the "Or" sequence and not the "And". The purpose
of the Search form is to allow users to filter the records to match the
criteria. Example: If they seleted "ABC Company" under "Entity" and
"Central Filing System" the return should show only those records for ABA
Company that are in the Central Filing System.

As of now I can get the "Or" sequence to work, but that results in showing
any record for ABC Comapny OR any record stored in the Central Filing System.
Two very different results.
 
THANK YOU, THANK YOU! I am not sure why it worked this time, but it does.
Not only can I see all the records I can filter the results based on one,
two, three, etc criteria!!!!

YEAH!!! Thank you Steve! If you are ever in the Puget Sound area of
Washington State drop me a line and I will buy you a beer!

Ember

Steve Schapel said:
Dear Ember,

(Like[Forms]![frmSearch]![Field Name])
Where on earth did you get this from??

In the case of removing the "*" default values in your criteria controls
(good idea!), the two approaches I suggested were:

[Forms]![frmSearch]![Field Name] Or [Forms]![frmSearch]![Field Name]
Is Null
Like Nz([Forms]![frmSearch]![Field Name],"*")

--
Steve Schapel, Microsoft Access MVP

Okay, I deleted the query and remade it, this time adding
(Like[Forms]![frmSearch]![Field Name]) one at a time. I also took out the
"default" value of "*" out of my search criteria. It is working now. The
subform is refreshing to show all records that contain the selected criteria.

However, it only works for the "Or" sequence and not the "And". The purpose
of the Search form is to allow users to filter the records to match the
criteria. Example: If they seleted "ABC Company" under "Entity" and
"Central Filing System" the return should show only those records for ABA
Company that are in the Central Filing System.

As of now I can get the "Or" sequence to work, but that results in showing
any record for ABC Comapny OR any record stored in the Central Filing System.
Two very different results.
 
Ember said:
I got that from the query. When I just enter [Forms]![frmSearch]![Field
Name] it adds the "Like" to the beginning of the line.

Ember, this is not normal behaviour.
 
Ember,

Lovely. I knew we'd get there eventually!

If you ever come to New Zealand, bring the beer with you :-).
 
Back
Top