Data not being placed in consecutive rows 
Author Message
 Data not being placed in consecutive rows

Hi Group

I have the code below working thanks to one of the forum experts. I`ve run
into
a strange problem. When I open the access table to view the data. I see the
first row is blank. My data is placed in the second row. It seems the data
is
not being placed in consecutive rows. I wondering what I screwed up to cause
this condition. Example 1st row black, second row data, third row blank,
then data again

Thanks as always.

procedure TfrmDrw.suiButton2Click(Sender: TObject);
begin
   if not (MaterialTable.State in [dsInsert]) then
      MaterialTable.Insert;
   with MaterialTable do
      begin
         FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text;
         FieldByName('MatStockType').Value := cboMatType.Text;
         FieldByName('MatPartName').Value := dbcboPartName.Text;
         FieldByName('MatSpecies').Value := dbcboSpecSolid.Text;
         FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text;
         FieldByName('MatFinishThkSolid').Value := dbedtFinThickSolid.Text;
         FieldByName('MatBdftCostSolid').Value := dbedtCostBdftSolid.Text;
         FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text;
         Post;
      end;
end;

end.



Tue, 29 Nov 2005 03:36:36 GMT  
 Data not being placed in consecutive rows
How are you putting the data into the table? It sounds like you may be
doing an Insert, which creates the blank line, and then AppendRecord,
which adds another record with the data.

HTH,
Dan

On Thu, 12 Jun 2003 19:36:36 GMT, "news.verizon.net"

Quote:

>Hi Group

>I have the code below working thanks to one of the forum experts. I`ve run
>into
>a strange problem. When I open the access table to view the data. I see the
>first row is blank. My data is placed in the second row. It seems the data
>is
>not being placed in consecutive rows. I wondering what I screwed up to cause
>this condition. Example 1st row black, second row data, third row blank,
>then data again

>Thanks as always.

>procedure TfrmDrw.suiButton2Click(Sender: TObject);
>begin
>   if not (MaterialTable.State in [dsInsert]) then
>      MaterialTable.Insert;
>   with MaterialTable do
>      begin
>         FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text;
>         FieldByName('MatStockType').Value := cboMatType.Text;
>         FieldByName('MatPartName').Value := dbcboPartName.Text;
>         FieldByName('MatSpecies').Value := dbcboSpecSolid.Text;
>         FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text;
>         FieldByName('MatFinishThkSolid').Value := dbedtFinThickSolid.Text;
>         FieldByName('MatBdftCostSolid').Value := dbedtCostBdftSolid.Text;
>         FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text;
>         Post;
>      end;
>end;

>end.



Tue, 29 Nov 2005 03:55:00 GMT  
 Data not being placed in consecutive rows
The below procedure is the technique I`m using to place the data
in the db.  There is a navigator control also. Would having that
control in addition to my procedure cause a conflict. I don`t have
a clue.

Quote:
> How are you putting the data into the table? It sounds like you may be
> doing an Insert, which creates the blank line, and then AppendRecord,
> which adds another record with the data.

> HTH,
> Dan

> On Thu, 12 Jun 2003 19:36:36 GMT, "news.verizon.net"

> >Hi Group

> >I have the code below working thanks to one of the forum experts. I`ve
run
> >into
> >a strange problem. When I open the access table to view the data. I see
the
> >first row is blank. My data is placed in the second row. It seems the
data
> >is
> >not being placed in consecutive rows. I wondering what I screwed up to
cause
> >this condition. Example 1st row black, second row data, third row blank,
> >then data again

> >Thanks as always.

> >procedure TfrmDrw.suiButton2Click(Sender: TObject);
> >begin
> >   if not (MaterialTable.State in [dsInsert]) then
> >      MaterialTable.Insert;
> >   with MaterialTable do
> >      begin
> >         FieldByName('MatJoint').Value := dbcboJointTypeSelect.Text;
> >         FieldByName('MatStockType').Value := cboMatType.Text;
> >         FieldByName('MatPartName').Value := dbcboPartName.Text;
> >         FieldByName('MatSpecies').Value := dbcboSpecSolid.Text;
> >         FieldByName('MatRoughThkSolid').Value := dbedtRghThkSolid.Text;
> >         FieldByName('MatFinishThkSolid').Value :=

dbedtFinThickSolid.Text;
Quote:
> >         FieldByName('MatBdftCostSolid').Value :=

dbedtCostBdftSolid.Text;

- Show quoted text -

Quote:
> >         FieldByName('MatWasteSolid').Value := dbedtPriceSqftSheet.Text;
> >         Post;
> >      end;
> >end;

> >end.



Tue, 29 Nov 2005 04:04:51 GMT  
 Data not being placed in consecutive rows
On Thu, 12 Jun 2003 20:04:51 GMT, "news.verizon.net"

Quote:

>The below procedure is the technique I`m using to place the data
>in the db.  There is a navigator control also. Would having that
>control in addition to my procedure cause a conflict. I don`t have
>a clue.

The navigator can insert a blank line, but it will depend on how it is
used and set up. If you don't force the selected row past the last
data row, I doubt if it is causing this.

I presume this is a live TTable or TQuery connected to the db. Are you
using CachedUpdates? Is AutoEdit true in the datasource? (allows the
dbgrid to insert a blank row)

I would set a breakpoint to step thru the whole process of adding a
row to make sure that it isn't doing something strange like running
twice, once with data, onece without.

HTH,
Dan



Sat, 03 Dec 2005 06:33:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Which row am I in?

2. Placing binary data in a table

3. sorting child data whilst lookup in place

4. Losing File Handles - But I am not using Files

5. Why am I not getting the RTE 200?

6. Consecutive eol's

7. Decision cube does not display 1 row

8. ReportSmith: I want a Row (not column) report

9. D1 - SQL Not Filling Last DBGrid Row

10. Data fields in row format?

11. Where do I save current row data

12. row in dataset from row in dbgrid

 

 
Powered by phpBB® Forum Software