>Forgot a piece of the code:
>
>It was suggested that I use sys(2015) to name my index files so they would be unique for multi user.
>
>uidfthis = Sys(2015)
>Index On custno To uidfthis
>
>Seek(AllT(This.DisplayValue)) Order uidfthis
>ThisForm.Refresh
>
>This will not give me the sys(2015) generated variable.
You need to use name expression, i.e. enclose the variable in parentheses:
lcCdxFileName=forcepath(forceext(sys(2015), "cdx"), justpath(dbf()))
index on custno tag custno of (lcCdxFileName)
...
seek(AllT(This.DisplayValue), "viewAliasGoesHere"[, "custno"])
Two remarks:
The path mumbo-jumbo I employed in the first line is just to make sure the file goes to your temp directory, and I'm getting that directory with justpath(dbf()) - the view resides there. Without setting the path, the temp index file is likely to end in the current directory, which is not where we want it.
"Index on ... to ..." will produce old 2.x-style (older actually) idx files, which are not compact, take up more space, can't have more than one tag per file, and lack some of the Rushmore stuff. Help states that they are used for Rushmore speedups, but I've read otherwise in this very thread. You can force an IDX file to newer technology (like 12 years versus 16) by adding the COMPACT keyword. Still, using the "index on ... tag ... of {filename}" syntax gives you a regular, multi-tagged cdx index file.
The only difference between this and the index you create on your regular tables is that it's not structural, which means it doesn't have the same name as the underlying table (which doesn't matter here, this is a view), it won't open whenever you open the table (doesn't apply to views anyway, they have no structural indexes) and so it won't update automatically unless you specifically open it (which we also don't care about here, because this is a temporary index).