Hello all!
I have an old program from 2002, which was coded in Delphi 7. Now i would like to rewrite the whole program, and expand in Visual Basic. But, i am just learning the language, and it is very difficult to me after Delphi, so i would like a little help. Can you help me, to convert my old code to VB2010? The code is very simple. I fill a database with Comboboxes and TextBoxes .Text.
My original D7 code is:
procedure TForm1.BtnAddNewLineClick(Sender: TObject);
begin
If (ComboBox1.Text='') or // Check empty
(ComboBox2.Text='') or
(ComboBox3.Text='') or
(ComboBox4.Text='') Then Begin
ShowMessage('Nem adhatsz hozzá üres sorokat!');
Exit;
end
else
with table1 do // Opening table
begin
Edit;
Last;
Append;
FieldByName('Date').AsString:=FormatDateTime('ddddd',date);
FieldByName('Time').AsString:=ComboBox1.Text+':'+ComboBox2.Text;
FieldByName('Partner').AsString:=ComboBox3.Text; // Filling the table specified Field with specified combobox.text
FieldByName('Client').AsString:=ComboBox4.Text;
FieldByName('City').AsString:=ComboBox5.Text;
FieldByName('Street').AsString:=ComboBox6.Text+', '+Edit1.Text;
FieldByName('Patrol').AsString:=ComboBox7.Text;
FieldByName('Save').AsString:='0';
Post;
ComboBox3.Text:=''; // clear combos
ComboBox4.Text:='';
ComboBox5.Text:='';
ComboBox6.Text:='';
ComboBox7.Text:='';
Edit1.Text:='';
Table1.Refresh;
end;
end;
The database in VB2010, is based on the video I made of.
Create a Database in VS2010
Thank you in advance for any help.