Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid columns not an object
Message
 
To
22/08/2000 15:36:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00407935
Message ID:
00407941
Views:
23
>Can anyone tell me what's wrong with the following code fragment?
>
>local lcSQLCmd
>
>with this.grdLookup
> .recordsource = ""
>
> lcSQLCmd = "select * from MASTCUS into cursor C_MASTCUS"
> lcSQLCmd = lcSQLCmd + thisform.SQLFilter
> &lcSQLCmd
>
> .recordsource = "C_MASTCUS"
> .columns[1].controlsource = "C_MASTCUS.CNAME"
> .columns[2].controlsource = "C_MASTCUS.CADDR"
> .columns[3].controlsource = "left(C_MASTCUS.CCITY,17)"
> .columns[4].controlsource = "right(C_MASTCUS.CCITY,2)"
> .columns[5].controlsource = "C_MASTCUS.CZIPCD"
> .columns[6].controlsource = "round(val(C_MASTCUS.CCUST),0)"
> .columns[7].controlsource = "mvPhone(C_MASTCUS.CPHONE, .T.)"
> .columns[8].controlsource = "C_MASTCUS.CDBANAME"
> .columns[9].controlsource = "C_MASTCUS.CLICNM"
> .columns[10].controlsource = "C_MASTCUS.CMGR"
> .columns[11].controlsource = "C_MASTCUS.COWNER"
>endwith
>
>When I run this code I get an error on the line .columns[10].controlsource, etc.
>If I comment out .columns[10] & .columns[11], no error!
>If I comment out .columns[8] & .columns[9] and renumber .columns[10] & .columns[11], TO .columns[8] & .columns[9], no error!
>
>Any Ideas?


After setting the recordsource for the grid set the columncount to 11. The grid is just making a best guess as to how many of the fields from the query you are going to be using in it. e.g. You are using CCITY 2 times and it is only going to expect this to be used once.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform