Put the SQL statement in the Form's Load event. By the time the Form Init fires, the Grid has already initialized. When it can't find the alias, I believe it unbinds itself.
HTH.
>I have a grid on a form. I have an SQL SELECT statement in the form init.
>
>My SELECT code:
>
>SELECT master.incident, master.patnum, master.patqty, master.name_last, master.name_first, ;
> master.sitename, master.addr1a, master.citya, ;
> master.mcoid, master.date, arrest.sca_ctr, arrest.closed, arrest.incident ;
> FROM master JOIN arrest ON master.incident = arrest.incident ;
> ORDER BY master.date INTO CURSOR cuRowSource
>
>
>I set Grid RowSource to cuRowSource and Grid RowSourceType to 1-Alias. How come I get a blank grid at run time. When I change Grid RowSource to the Default I get a grid showing my Column Headings and Widths, but the columns are partially filled with data from my SELECT and some columns are left blank. I have never used a grid like a Listbox before. What might I be doing wrong?
>
>I assign the grid's column headings and column widths in the Grid Init Event. Do I have to also assign each column to a SQL SELECT fieldname? Or how is that done? I assumed the SQL SELECT would fill the grid in the order that the fields are listed in the SQL SELECT statement. But that's when I get a blank grid with no headings, no lines, no data. What's wrong?
>
>Thanks so much.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao