I`m attempting to add data to a access table. When I click
suiButton2 all the data in the dbedtboxes disappears. That
wasn`t what I wanted. How do I correct this problem
Also, How would I setup this code to add a new set of data
to the table each time the button is clicked. As it is if
I enter new data it overwrites the exsisting data but does
not add a new row.
PS.Thanks for you help.....greatly appreciated.
procedure TfrmDrw.suiButton2Click(Sender: TObject);
begin
if not (ADOTableControls.State in [dsInsert, dsEdit]) then
ADOTableControls.Edit;
with ADOTableControls do begin
Insert;
FieldByName('MatSolidSpecies').Value := dbcboSpecSolid.Text;
FieldByName('MatSolidRoughThk').Value := dbedtRghThkSolid.Text;
FieldByName('MatSolidFinishThk').Value := dbedtFinThickSolid.Text;
Post;
end;
end;
end.
suiButton2 all the data in the dbedtboxes disappears. That
wasn`t what I wanted. How do I correct this problem
Also, How would I setup this code to add a new set of data
to the table each time the button is clicked. As it is if
I enter new data it overwrites the exsisting data but does
not add a new row.
PS.Thanks for you help.....greatly appreciated.
procedure TfrmDrw.suiButton2Click(Sender: TObject);
begin
if not (ADOTableControls.State in [dsInsert, dsEdit]) then
ADOTableControls.Edit;
with ADOTableControls do begin
Insert;
FieldByName('MatSolidSpecies').Value := dbcboSpecSolid.Text;
FieldByName('MatSolidRoughThk').Value := dbedtRghThkSolid.Text;
FieldByName('MatSolidFinishThk').Value := dbedtFinThickSolid.Text;
Post;
end;
end;
end.