Topic: Event Handler must be a procedure
Hello Dmitry and all MVD users. Please Help me out
I get this error "Event Handler Must Be a Procedure". Meanwhile the event is a procedure. Check this and help me out
procedure exeat_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
http: variant;
url,userpassword,username,sms,phone :string;
Begin
If SqlExecute('Select Count(id_students) FROM exeat WHERE exeat.id_students=' + exeat.combobox2.sqlValue) > 0 then
begin
MessageBox('This student is already on Exeat','Error',MB_OK+MB_ICONERROR);
Cancel := True;
exeat.combobox2.SetFocus;
Exit;
end;
if ping('google.com') then
begin
SQLExecute('INSERT INTO report (exeatfrom, exeatto, purpose, id_students, id_class, action) VALUES('+
Exeat.DateTimePicker1.sqlDateTime + ', ' + Exeat.DateTimePicker2.sqlDateTime + ', ' +
Exeat.Memo1.sqlValue + ', ' + Exeat.ComboBox2.sqlValue + ', ' + Exeat.ComboBox1.sqlValue + ', "on Exeat")');
frmReport.TableGrid1.dbUpdate;
username := 'hotice@live.com';
userpassword := 'hot0208914692';
sms := exeat.Memo3.text;
phone := exeat.Edit1.text;
http:=createoleobject('WinHttp.WinHttpRequest.5.1');
user='+username+'&password='+userpassword+'&message='+sms+'&type=0&sender=SCHOOL NAME&destination='+phone+'';
browser.Edit1.Text:= url;
browser.Button1.click;
end
else
begin
MessageBox('No internet Connection','Error',MB_OK+MB_ICONWARNING);
Cancel := True;
Exit;
end;
End;