A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

embed a query into a form that has the query criteria



 
 
Thread Tools Display Modes
  #21  
Old March 28th, 2006, 10:59 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default embed a query into a form that has the query criteria

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 we

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

--
Steve Schapel, Microsoft Access MVP


Ember wrote:
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.

  #22  
Old March 28th, 2006, 11:20 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default embed a query into a form that has the query criteria

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" wrote:

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 we

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

--
Steve Schapel, Microsoft Access MVP


Ember wrote:
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.


  #23  
Old March 28th, 2006, 11:27 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default embed a query into a form that has the query criteria

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" wrote:

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 we

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

--
Steve Schapel, Microsoft Access MVP


Ember wrote:
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.


  #24  
Old March 29th, 2006, 02:13 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default embed a query into a form that has the query criteria

Ember wrote:
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.

--
Steve Schapel, Microsoft Access MVP
  #25  
Old March 29th, 2006, 02:15 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default embed a query into a form that has the query criteria

Ember,

Lovely. I knew we'd get there eventually!

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

--
Steve Schapel, Microsoft Access MVP

Ember wrote:
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!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Customers- Contracts form problem GL Using Forms 10 February 7th, 2006 04:05 PM
using a form with combo box to input criteria Christina Using Forms 16 February 3rd, 2006 08:47 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
Form to Enter Report Criteria works, but Query won't run from Macr BARKAROO Using Forms 1 October 16th, 2004 08:13 PM
Print Taher Setting Up & Running Reports 1 August 31st, 2004 09:07 PM


All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.