Re: select statement problem by Rick
Rick
Thu Sep 16 14:50:24 CDT 2004
George,
As long as you are working in VFP 7.0 and higher. Eddy didn't say what =
version was in use.
Rick
"George" <SpamMyAss@Mailinator.com> wrote in message =
news:%23qwT06%23mEHA.3968@TK2MSFTNGP11.phx.gbl...
> better yet:
>=20
> Text To sqlCommand NoShow
> select pinvitem.invnum, pinvitem.partno, invoice.invdate
> from pinvitem, pinvoice into table invallo
> where pinvoice.invdate =3D date()
> and pinvoice.invnum =3D pinvitem.invnum and pinvitem.recstat =
=3D 'P'
> order by pinvitem.invnum, pinvitem.partno asc
> EndText
>=20
> thisform.grid1.RowSource =3D sqlCommand
>=20
> best practice?
> Run the select first, then assign the cursor as rowsource
>=20
> Another thing, you should Dodefault() in the init of the form in order =
> to create all the controls before doing things with them, and then do=20
> your code.
>=20
> Just in case, you never know
>=20
> hth
>=20
>=20
>=20
> Eddy wrote:
>=20
>> Hi,=20
>> The following statement is placed in the init event of myform
>>=20
>> thisform.grid1.RowSource =3D "select pinvitem.invnum, =
pinvitem.partno,=20
>> invoice.invdate ;
>> from pinvitem, pinvoice into table invallo where pinvoice.invdate =3D =
date() ;
>> and pinvoice.invnum =3D pinvitem.invnum and pinvitem.recstat =3D 'P' =
;
>> order by pinvitem.invnum, pinvitem.partno asc"
>>=20
>> thisform.grid1.RowSourceType =3D 4
>>=20
>> I got an error message : 'commands contains unrecognized =
pharse/keyword'
>>=20
>> but I do the above 'select' statement alone , it has no error at all.
>> please give me a hand
>> thanks