I try to create new records in a my custom Telephone table when a button is clicked. but, ...

Hello Everyone,

I have a table Int_smmTelephone that have the fields areaCode and phoneNumber.

I have designed a form to fill these columns of table. But I have created independent textFields that is they have no datasource.

When a button is clicked on the form, the text values of the text fields will be written to table.

My issue is I have two phone number, cellular and normal phone. When I try to insert these records to table, it just writes the first part that is, Int_smmTelephone_AreaCode.text() and Int_smmTelephone_PhoneNumber.text().

It creates second row but it is empty. It is not filled with the records in Int_smmTelephone_AreaCode1.text() and Int_smmTelephone_PhoneNumber1.text() .

What might be the my problem?

My code is as follows;

Int_smmTelephone.insert();

Int_smmTelephone.AreaCode = Int_smmTelephone_AreaCode.text();

Int_smmTelephone.PhoneNumber = Int_smmTelephone_PhoneNumber.text();

Int_smmTelephone.insert();

Int_smmTelephone.AreaCode = Int_smmTelephone_AreaCode1.text();

Int_smmTelephone.PhoneNumber = Int_smmTelephone_PhoneNumber1.text();

Thanks

Erdem

So you have four text fields in a form.two of them to be inserted as one record and other two as one more record.

call the insert() method after filling the values in the table fields.

Int_smmTelephone.AreaCode = Int_smmTelephone_AreaCode.text();

Int_smmTelephone.PhoneNumber = Int_smmTelephone_PhoneNumber.text();

Int_smmTelephone.insert();

Int_smmTelephone.AreaCode = Int_smmTelephone_AreaCode1.text();

Int_smmTelephone.PhoneNumber = Int_smmTelephone_PhoneNumber1.text();

Int_smmTelephone.insert();

Thank you Kranthi

I missed that part, I should know that I need to put insert after assigning. I confused it with create method :slight_smile:

Erdem