Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01161719
Message ID:
01161809
Views:
22
>All of the below is contained within a WITH_ENDWITH on the grid.
>
>
>	IF USED('curDisplay')
>		lnCurrentRow = RECNO('curDisplay')
>
>	ELSE
>		lnCurrentRow = 1
>	
>	ENDIF
>	
>	lsSQL = 	"SELECT curWorking.UniqueID, curWorking.IsSelected, " +;
>			"curWorking.Invert, curWorking.IsRestricted, " +;
>			"!ISNULL(curWorking.Annotation) as HasNote," +;
>			"TTOD(curWorking.ClearDate) AS ClearDate, curRecon.SWDN, " +;
>			"curRecon.PrimaryDoc, curRecon.CAAmount, curRecon.DAAmount, " +;
>			"curRecon.AuditDate, " +;
>			"curRecon.MachineDate, curRecon.SecondaryDoc, curRecon.Site, " +;
>			"curRecon.Source, curRecon.GLC, curRecon.ReconMonth, " +;
>			"curRecon.TransactionType, curRecon.LastRFA " +;
>		   	"FROM curWorking " +;
>		   	"INNER JOIN curRecon ON curWorking.UniqueID = curRecon.UniqueID " +;
>		   	"INTO CURSOR curDisplay READWRITE " +;
>		   	"WHERE ISNULL(curWorking.MatchedTo) AND " +;
>		   	"curRecon.RecordType = '" + lsRecordType + "' AND " +;
>			"ALLTRIM(curRecon.Account + NVL(curRecon.CFI,'')) == '" + lsAccount + "' "+;
>			IIF(THIS.Parent.chkDisplayCleared.Value, "" ,;
>				"AND ISNULL(curWorking.ClearDate) ") +;
>			"ORDER BY " + .SortOrder + " " + .SortDirection
>
>	.RecordSource =  ''
>
>	&lsSQL.
>
>	IF !USED('curDisplay')
>		MESSAGEBOX("The Display cursor failed. Contact programmer. DO NOT CLOSE THIS!" + CR+;
>				lsSQL)
>
>	ENDIF
>
>	.RecordSource = 'curDisplay'
>	.grcSelect.ControlSource = 'curDisplay.IsSelected'
>	.grcReversed.ControlSource= 'curDisplay.Invert'
>...
>
>
>I'm also trying it with the permanent cursor method... BUT I'm running into a case where it's doubling the records. That may be a case of me running through some of the nuances of that method.
>
>Richard
>
The code seems to be fine, but I think there was a recent similar problem. Let me try to find that thread.

BTW, what Tore suggested is exactly the approach I'm always using as well. Perhaps you may use it too instead of working around grid reconstruction problem.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform