Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid, Putting Current Record @ 1st Row when Refreshing
Message
 
To
30/09/1999 15:43:44
Sony Joseph
Dovenmuehle Mortgage Inc
Schaumburg, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00270678
Message ID:
00271532
Views:
20
>Hi Chuck,
>I use the following code to accomplish this.
>
>
>thisform.lockscreen=.t.
>do while thisform.grid1.relativerow > 1
> thisform.grid1.doscroll(1)
>enddo
>thisform.lockscreen=.f.
>
>assuming that you had already issued the SEEK command.
>
>
>Hope this helps
>S.

Hi Sony,

I tried the following code, but it's not working for me. Any suggestions? TIA, Chuck.
* This is in cmdGo.Click event.
SELECT OpShp
SET EXACT ON
SEEK mLocateNumber
SET EXACT OFF
IF EOF() = .T.
	MESSAGEBOX("Could not locate the number " + mLocateNumber + " on file." + CHR(13) + ;
		+ CHR(13) + ;
		"Make sure you entered a valid number.", ;
		0+32+0, ;
		"Unable to Locate Number Entered")
	ThisForm.StartEdit(.F.)
	ThisForm.txtLocateNumber.SetFocus
	RETURN
ELSE

	* When examining the following debugging code, mRow
        * always evaluates to 0 even though the SEEK has obviously
        * been successfully done above.
        ThisForm.Refresh
	mRow = ThisForm.Grid1.RelativeRow
	MESSAGEBOX(STR(mRow))
	
        ThisForm.LockScreen = .T.
	DO WHILE ThisForm.Grid1.RelativeRow > 1
		ThisForm.Grid1.DoScroll(1)
	ENDDO
	ThisForm.LockScreen = .F.
	ThisForm.Refresh

	ThisForm.StartEdit(.T.)

ENDIF
Chuck Henry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform