Thanks, Danny.
I'll take a look at your test/sample files tonight or tomorrow.
In the meantime, I discovered that although the code I posted before did work for the opening screen, the "Found()" record didn't always show at the top row of the browse in other bits of code where I had to assign the value right before a refresh.
Also, it only works properly for the opening screen when the browse's definition value set to 0. Anything else (1+) and the pointer goes to the assigned record rather than to the "Go [To]" record! So there is absolutely nothing before GoToNow() that assigns a value to the browse -- only a few .T. or .F. assignments, some "Set XXX On/Off" statements and then a call to a function that opens tables, builds index files, and sets relations. (The final table opened and indexed is the browse's workarea.)
However, I found a way that allows the opening screen to work (as previously shown, not using the code below), but which also works in all the other places/cases I've tested:
Code: Select all
DbSeek ( SrchDate, .T. )
If Eof()
Go Top
Endif
nRec := RecNo()
UCMain.Browse_1.Value := RecCount()+1
Go nRec
UCMain.Browse_1.Refresh
UCMain.Browse_1.SetFocus
That, too, doesn't seem to make a lot of sense, but... It seems that the rule is:
IF the browse value is set to 0 (i.e., to not display!), either in the window control definition or by assigning "<Window>.<Browse>.Value := RecCount()+1", THEN a subsequent Go [To] command followed by Refresh and SetFocus DOES display the browse, with the Found() record on the top row.
If that's not the rule, then I'm sure that someone will let me know, but I'm pretty sure of it now. Above all, I'm just happy that it all seems to be working!
Thanks again.
CalScot