From: dirtrhoads on
I have a form which has subforms to show me my active orders and inventory
information. I want to be able to double click or just click the PO Number to
open that record in my Order Details form. I tried creating a macro by
mimicking the one in the Northwind 2007 database but when I do it in mine I
receive an error which states:

"Syntax Error (missing Operator) in query expression '[PO_Number]=PHX
0085453'"

Is this because the PO_Number is not the primary key? Should I be using the
primary key to double click?

Any suggestions will be greatly appreciated.

Thank you,
Amy
From: Daryl S on
Dirtrhoads -

I suspect you need delimiters for your text value. Your end results would be:
[PO_Number]='PHX 0085453'
but you are probably passing this in, so it would be built something like
this (using your form and control names):
"[PO_Number]='" & forms!yourformname!yourPONumberControlName & "'"

--
Daryl S


"dirtrhoads" wrote:

> I have a form which has subforms to show me my active orders and inventory
> information. I want to be able to double click or just click the PO Number to
> open that record in my Order Details form. I tried creating a macro by
> mimicking the one in the Northwind 2007 database but when I do it in mine I
> receive an error which states:
>
> "Syntax Error (missing Operator) in query expression '[PO_Number]=PHX
> 0085453'"
>
> Is this because the PO_Number is not the primary key? Should I be using the
> primary key to double click?
>
> Any suggestions will be greatly appreciated.
>
> Thank you,
> Amy
From: dirtrhoads on
Would I put this in OpenForm Arguments field of the Macro?

"Daryl S" wrote:

> Dirtrhoads -
>
> I suspect you need delimiters for your text value. Your end results would be:
> [PO_Number]='PHX 0085453'
> but you are probably passing this in, so it would be built something like
> this (using your form and control names):
> "[PO_Number]='" & forms!yourformname!yourPONumberControlName & "'"
>
> --
> Daryl S
>
>
> "dirtrhoads" wrote:
>
> > I have a form which has subforms to show me my active orders and inventory
> > information. I want to be able to double click or just click the PO Number to
> > open that record in my Order Details form. I tried creating a macro by
> > mimicking the one in the Northwind 2007 database but when I do it in mine I
> > receive an error which states:
> >
> > "Syntax Error (missing Operator) in query expression '[PO_Number]=PHX
> > 0085453'"
> >
> > Is this because the PO_Number is not the primary key? Should I be using the
> > primary key to double click?
> >
> > Any suggestions will be greatly appreciated.
> >
> > Thank you,
> > Amy
From: Daryl S on
Dirtrhoads -

Depending on the form you are opening, you can pass this in as as a WHERE
condition, or as OpenArgs. If you use the WHERE clause, then you won't need
to code for it in the new form. If you use OpenArgs, you will need to
evaluate it (usually in the Open event of the form), and then apply it
appropriately. The WHERE condition is easier to use for just a filter.

--
Daryl S


"dirtrhoads" wrote:

> Would I put this in OpenForm Arguments field of the Macro?
>
> "Daryl S" wrote:
>
> > Dirtrhoads -
> >
> > I suspect you need delimiters for your text value. Your end results would be:
> > [PO_Number]='PHX 0085453'
> > but you are probably passing this in, so it would be built something like
> > this (using your form and control names):
> > "[PO_Number]='" & forms!yourformname!yourPONumberControlName & "'"
> >
> > --
> > Daryl S
> >
> >
> > "dirtrhoads" wrote:
> >
> > > I have a form which has subforms to show me my active orders and inventory
> > > information. I want to be able to double click or just click the PO Number to
> > > open that record in my Order Details form. I tried creating a macro by
> > > mimicking the one in the Northwind 2007 database but when I do it in mine I
> > > receive an error which states:
> > >
> > > "Syntax Error (missing Operator) in query expression '[PO_Number]=PHX
> > > 0085453'"
> > >
> > > Is this because the PO_Number is not the primary key? Should I be using the
> > > primary key to double click?
> > >
> > > Any suggestions will be greatly appreciated.
> > >
> > > Thank you,
> > > Amy
From: dirtrhoads on
I'm sorry. I've never created a macro before, so I have no idea what any of
this means. Would it be easier to put code in the double click event? I tried
putting the statement you gave me in the WHERE clause of the macro and it
still didn't work. Are you saying that I also need to do something on the
FORM property sheet as well if I go with the Macro?

"Daryl S" wrote:

> Dirtrhoads -
>
> Depending on the form you are opening, you can pass this in as as a WHERE
> condition, or as OpenArgs. If you use the WHERE clause, then you won't need
> to code for it in the new form. If you use OpenArgs, you will need to
> evaluate it (usually in the Open event of the form), and then apply it
> appropriately. The WHERE condition is easier to use for just a filter.
>
> --
> Daryl S
>
>
> "dirtrhoads" wrote:
>
> > Would I put this in OpenForm Arguments field of the Macro?
> >
> > "Daryl S" wrote:
> >
> > > Dirtrhoads -
> > >
> > > I suspect you need delimiters for your text value. Your end results would be:
> > > [PO_Number]='PHX 0085453'
> > > but you are probably passing this in, so it would be built something like
> > > this (using your form and control names):
> > > "[PO_Number]='" & forms!yourformname!yourPONumberControlName & "'"
> > >
> > > --
> > > Daryl S
> > >
> > >
> > > "dirtrhoads" wrote:
> > >
> > > > I have a form which has subforms to show me my active orders and inventory
> > > > information. I want to be able to double click or just click the PO Number to
> > > > open that record in my Order Details form. I tried creating a macro by
> > > > mimicking the one in the Northwind 2007 database but when I do it in mine I
> > > > receive an error which states:
> > > >
> > > > "Syntax Error (missing Operator) in query expression '[PO_Number]=PHX
> > > > 0085453'"
> > > >
> > > > Is this because the PO_Number is not the primary key? Should I be using the
> > > > primary key to double click?
> > > >
> > > > Any suggestions will be greatly appreciated.
> > > >
> > > > Thank you,
> > > > Amy