1 (edited by dbk 2019-08-09 17:16:51)

Topic: [SOLVED] '''' is not a valid integer value

Hello friends,

I have the following script. When i run it the first time, everything works perfectly, however when i close the form and try to open another record it gives me the following error:


Error:

Attached image


Script:

var
     amountofdays: integer;

begin

      amountofdays:= SQLExecute('SELECT paymentterm FROM client WHERE id='+ IntToStr(frmAddInvoice.ComboBox2.dbItemID) );
          
          if amountofdays = 0
              then
              amountofdays:= 8;

      frmAddInvoice.DateTimePicker2.DateTime := frmAddInvoice.DateTimePicker1.DateTime + amountofdays;

      frmAddInvoice.Edit4.Text := IntToStr(amountofdays);

end;

Could somebody point out what i am doing wrong?

Post's attachments

Attachment icon not a valid integer value.png 1.97 kb, 145 downloads since 2019-08-01 

Re: [SOLVED] '''' is not a valid integer value

Hello.



Please attach your project.

Dmitry.

3 (edited by dbk 2019-08-06 20:40:43)

Re: [SOLVED] '''' is not a valid integer value

Hello,


I managed to get rid of the error by using

procedure frmAddInvoice_DateTimePicker1_OnChange (Sender: TObject); 
var
      amountofdays : extended;
begin
      amountofdays := frmAddInvoice.Edit4.Value;
      frmAddInvoice.DateTimePicker2.DateTime := frmAddInvoice.DateTimePicker1.DateTime + amountofdays;
end;

However, when this error was gone, the next one comes up.


Now i am getting this error in my existing report:


Could not convert variant of type (UnicodeString) into type (Double).

sad


When i remove the code, the report just works again, but the dates wont change when Edit is changed.

Re: [SOLVED] '''' is not a valid integer value

Without attached project I can't help you.

Dmitry.

Re: [SOLVED] '''' is not a valid integer value

DriveSoft wrote:

Without attached project I can't help you.

Hello Dmitry,

I sent you you the project via email.

Re: [SOLVED] '''' is not a valid integer value

I have not received it. Please try again with link on this topic.

Dmitry.

Re: [SOLVED] '''' is not a valid integer value

This is fixed by Dmitry, was a script error in the report itself!