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
|