>Still isn't right, so I'm giving up on the cursor idea and going with the "into table nofilter" scheme. The only problem now is that all the grid is showing is the same record repeated over and over.
>
>Here's the code in the init of the form:
>
James,
I tried this with one of my tables and had no problem getting it to work with the following changes I've indicated.
>if thisform.r_noloadhsfrmaddfoals
> return .f.
>else
> select name, yr_bred from master where type = "B" into table namebred nofilter
You do not need NOFILTER on this since you are creating a table. Not sure if it's ignored for tables, but if not this will slow down the query.
However, I would recommend continuing to use a cursor - if this app ever needs to be multiuser, you will overwrite one namebred with another at some point.
In that case, keep the NOFILTER, just to be safe since you will want to index it.
Also,
name is a keyword in VFP - avoid naming anything (fields, variables, tables, etc) the same as keywords. I don't know if this is causing a problem, but it could be.
select name, yr_bred from master where type = "B" into cursor namebred nofilter
>inde on name to name
Put a GO TOP after creating index, instead of a locate later - it's faster.
>with thisform.hspageframe1.page1.hsgrid1
> .columncount = 2
> .column1.width = 200
> .column2.width = 75
> .recordsourcetype = 0
change to RecordSourceType = 1
This may be what's giving you the repeated record, I'm not sure....
> .recordsource = "NAMEBRED"
> .column1.controlsource = "namebred.name"
> .column2.controlsource = "namebred.yr_bred"
> endwith
>locate
nix this locate
>endif
>
>Any ideas on hwo to get the grid to show all the records, not just the first record repeated?
>
>TIA,
>
>Jim Harvey
>
jharvey@netrax.net
Insanity: Doing the same thing over and over and expecting different results.