fitzgerald
Technical User
Nearly at the end of my program but there's one problem that I cannot get around:
My database is done in Paradox7.
I have a DBGrid that displays records contained within a database. You can select individual records within the DBGrid. The records have a "ReturnDate" field, which is of Type: Date, and I want the program to CLEAR this field (so there is NO information remaining in it) of the selected record when a button is pressed.
Here's the code I have so far:
procedure TForm3.Button6Click(Sender: TObject);
begin
Table1.Edit;
Table1.FieldValues['RentedVideo']:='';
Table1.FieldValues['ReturnDate']:='';
Table1.Post;
Table1.Refresh;
end;
I have got some code that clears the other field in the database (This one is called "RentedVideo" and is Type: Alphanumeric) and this works fine.
Problem is, when it tries to clear the "ReturnDate" field, I get the error: "Invalid Variant Type Conversion". I'm assuming that this is because the field is a Date type, because the Alphanumeric field clears fine.
Any help will be greatly appreciated as always
My database is done in Paradox7.
I have a DBGrid that displays records contained within a database. You can select individual records within the DBGrid. The records have a "ReturnDate" field, which is of Type: Date, and I want the program to CLEAR this field (so there is NO information remaining in it) of the selected record when a button is pressed.
Here's the code I have so far:
procedure TForm3.Button6Click(Sender: TObject);
begin
Table1.Edit;
Table1.FieldValues['RentedVideo']:='';
Table1.FieldValues['ReturnDate']:='';
Table1.Post;
Table1.Refresh;
end;
I have got some code that clears the other field in the database (This one is called "RentedVideo" and is Type: Alphanumeric) and this works fine.
Problem is, when it tries to clear the "ReturnDate" field, I get the error: "Invalid Variant Type Conversion". I'm assuming that this is because the field is a Date type, because the Alphanumeric field clears fine.
Any help will be greatly appreciated as always