DataGrid "Column Not Found" error 
Author Message
 DataGrid "Column Not Found" error

I'm running VB6, ADO to Jet 4.0, and have a grid bound to a
datasource.  Now I add an extra column, unbound, programatically with
DataGrid.Columns.Add(index) and it appears to work when I run a
report. The new column is visible. I even can set the Caption for the
new column and it appears in the column heading in the report.  All
appears fine until I try to put some data in the cells for the new
columm. At runtime, as soon as my code tries to add Values to the
cells I get a "Column not Found" error.  I try typing some data in the
cells and I get the same error when I hit Enter.  Is the column R/O
somehow?

Grid properties:
1. Visible=True
2. Enabled=True
3. Allow Update = True
4. Allow Delete = True
5. Allow Add New = True

The code:

       Dim ColumnCount As Integer

        ColumnCount = grdReportsGrid.Columns.Count
           grdReportsGrid.Columns.Add (ColumnCount)
              grdReportsGrid.Columns(ColumnCount).Caption = "Total"
                grdReportsGrid.Columns(ColumnCount).Locked = False
                  grdReportsGrid.Columns(ColumnCount).Visible = True

    For i = 0 To grdReportsGrid.ApproxCount - 1
     grdReportsGrid.Row = 0 + i
      Sum = Sum + grdReportsGrid.Columns(0).Value
       grdReportsGrid.Columns(ColumnCount).Value = Sum  <-------bombs
here

              Next

When I step through this I see that "Sum" has the correct value, and
(ColumnCount) has the correct value (an index of 4 for a fith column.)

Thanks for any help you can give me.  Paul



Sat, 30 Jul 2005 13:08:49 GMT  
 DataGrid "Column Not Found" error
Could it be a misguided error message and that it is trying to update a record column  that doesn't exist in the database..
Just a guess on my part. I don't use bound controls...


Quote:
>I'm running VB6, ADO to Jet 4.0, and have a grid bound to a
>datasource.  Now I add an extra column, unbound, programatically with
>DataGrid.Columns.Add(index) and it appears to work when I run a
>report. The new column is visible. I even can set the Caption for the
>new column and it appears in the column heading in the report.  All
>appears fine until I try to put some data in the cells for the new
>columm. At runtime, as soon as my code tries to add Values to the
>cells I get a "Column not Found" error.  I try typing some data in the
>cells and I get the same error when I hit Enter.  Is the column R/O
>somehow?

>Grid properties:
>1. Visible=True
>2. Enabled=True
>3. Allow Update = True
>4. Allow Delete = True
>5. Allow Add New = True

>The code:

>       Dim ColumnCount As Integer

>        ColumnCount = grdReportsGrid.Columns.Count
>           grdReportsGrid.Columns.Add (ColumnCount)
>              grdReportsGrid.Columns(ColumnCount).Caption = "Total"
>                grdReportsGrid.Columns(ColumnCount).Locked = False
>                  grdReportsGrid.Columns(ColumnCount).Visible = True

>    For i = 0 To grdReportsGrid.ApproxCount - 1
>     grdReportsGrid.Row = 0 + i
>      Sum = Sum + grdReportsGrid.Columns(0).Value
>       grdReportsGrid.Columns(ColumnCount).Value = Sum  <-------bombs
>here

>              Next

>When I step through this I see that "Sum" has the correct value, and
>(ColumnCount) has the correct value (an index of 4 for a fith column.)

>Thanks for any help you can give me.  Paul

Have a good day...

Don



Sat, 30 Jul 2005 14:28:47 GMT  
 DataGrid "Column Not Found" error

Quote:

> Could it be a misguided error message and that it is trying to update a record column  that doesn't exist in the database..
> Just a guess on my part. I don't use bound controls...

Hi Don,
I actually added another column to the table with the appropriate data
type and name, just in case it was trying to do something with the DB.
 It did no good, though.

The weird thing is that I can write to the Caption of the column, so
if it doesn't exist, how can I do that?  I can write to the Caption
but I can't write a Value.  Totally weird.  ~Paul

Quote:

> >I'm running VB6, ADO to Jet 4.0, and have a grid bound to a
> >datasource.  Now I add an extra column, unbound, programatically with
> >DataGrid.Columns.Add(index) and it appears to work when I run a
> >report. The new column is visible. I even can set the Caption for the
> >new column and it appears in the column heading in the report.  All
> >appears fine until I try to put some data in the cells for the new
> >columm. At runtime, as soon as my code tries to add Values to the
> >cells I get a "Column not Found" error.  I try typing some data in the
> >cells and I get the same error when I hit Enter.  Is the column R/O
> >somehow?

> >Grid properties:
> >1. Visible=True
> >2. Enabled=True
> >3. Allow Update = True
> >4. Allow Delete = True
> >5. Allow Add New = True

> >The code:

> >       Dim ColumnCount As Integer

> >        ColumnCount = grdReportsGrid.Columns.Count
> >           grdReportsGrid.Columns.Add (ColumnCount)
> >              grdReportsGrid.Columns(ColumnCount).Caption = "Total"
> >                grdReportsGrid.Columns(ColumnCount).Locked = False
> >                  grdReportsGrid.Columns(ColumnCount).Visible = True

> >    For i = 0 To grdReportsGrid.ApproxCount - 1
> >     grdReportsGrid.Row = 0 + i
> >      Sum = Sum + grdReportsGrid.Columns(0).Value
> >       grdReportsGrid.Columns(ColumnCount).Value = Sum  <-------bombs
> >here

> >              Next

> >When I step through this I see that "Sum" has the correct value, and
> >(ColumnCount) has the correct value (an index of 4 for a fith column.)

> >Thanks for any help you can give me.  Paul

> Have a good day...

> Don



Sun, 31 Jul 2005 09:33:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DataGrid "Column Not Found" error

2. Solution to DataGrid "column not found" error (VB6, ADO)

3. Solution to DataGrid "column not found" error (VB6, ADO)

4. "Module not found" error

5. "Module not found" error

6. "Project Not Found" Error

7. ODBC error - "file not found" Help

8. Strange "File not found" error

9. "File not found" error

10. Error 32504 "File not Found"

11. "license not found" errors

12. "license not found" error

 

 
Powered by phpBB® Forum Software