PC Review


Reply
Thread Tools Rate Thread

criteria for queries

 
 
Simon
Guest
Posts: n/a
 
      19th Dec 2006
I have a query with a critera for Order number as
[forms]![frmInvoiceNumber]![ordernumber] Or
[forms]![frmAllInvoices]![ordernumber]


The reason why i need this criteria is that it all depends which form i
am on and which ones i want to run the queriy from

When i run this query from frmAllInvoices it brings up a message box
asking me to enter the order number. if i just click ok it then
displayes the correct information as its uses the second part of the
criterai [forms]![frmAllInvoices]![ordernumber]


If there a way to stop it bringing up the message for me to enter the
first critera. I was expecting as i had the OR between it it would only
neeed one bit of data

 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      19th Dec 2006
On 19 Dec 2006 13:10:16 -0800, Simon wrote:

> I have a query with a critera for Order number as
> [forms]![frmInvoiceNumber]![ordernumber] Or
> [forms]![frmAllInvoices]![ordernumber]
>
> The reason why i need this criteria is that it all depends which form i
> am on and which ones i want to run the queriy from
>
> When i run this query from frmAllInvoices it brings up a message box
> asking me to enter the order number. if i just click ok it then
> displayes the correct information as its uses the second part of the
> criterai [forms]![frmAllInvoices]![ordernumber]
>
> If there a way to stop it bringing up the message for me to enter the
> first critera. I was expecting as i had the OR between it it would only
> neeed one bit of data


Create a separate form to enter the parameter value in.
This way you need to just reference that one form in the query
criteria.
You would call it from both of the other forms when you wish to run
the query.

DoCmd.OpenForm "frmCriteriaEntry", , , , , acDialog
DoCmd.OpenQuery "QueryName"
DoCmd.Close acForm, "frmCritiriaEntry"


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
Simon
Guest
Posts: n/a
 
      19th Dec 2006
Thanks

I will have a play

Is there any other way of doing it instead of creating another form

Thanks


SImon
fredg wrote:
> On 19 Dec 2006 13:10:16 -0800, Simon wrote:
>
> > I have a query with a critera for Order number as
> > [forms]![frmInvoiceNumber]![ordernumber] Or
> > [forms]![frmAllInvoices]![ordernumber]
> >
> > The reason why i need this criteria is that it all depends which form i
> > am on and which ones i want to run the queriy from
> >
> > When i run this query from frmAllInvoices it brings up a message box
> > asking me to enter the order number. if i just click ok it then
> > displayes the correct information as its uses the second part of the
> > criterai [forms]![frmAllInvoices]![ordernumber]
> >
> > If there a way to stop it bringing up the message for me to enter the
> > first critera. I was expecting as i had the OR between it it would only
> > neeed one bit of data

>
> Create a separate form to enter the parameter value in.
> This way you need to just reference that one form in the query
> criteria.
> You would call it from both of the other forms when you wish to run
> the query.
>
> DoCmd.OpenForm "frmCriteriaEntry", , , , , acDialog
> DoCmd.OpenQuery "QueryName"
> DoCmd.Close acForm, "frmCritiriaEntry"
>
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Queries Criteria-Not Like Steven P via AccessMonster.com Microsoft Access Queries 5 16th Jan 2006 06:44 PM
Criteria for Queries =?Utf-8?B?cmFt?= Microsoft Access 2 22nd Sep 2005 09:43 PM
Criteria in Queries =?Utf-8?B?Um9iQFdDQkE=?= Microsoft Access Queries 1 1st Jun 2005 12:16 AM
RE: Criteria in Queries =?Utf-8?B?T2Zlcg==?= Microsoft Access Queries 0 31st May 2005 11:56 PM
Need help with Criteria for Queries Pls Matt Microsoft Access Queries 2 9th Mar 2004 03:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:38 AM.