Help with data entry form

Even I have doubt on this.

I have first dropdown and text fields in my screen.
I using all these input fields to insert data into database.

image

after selecting line from dropdown, example : R22
since it is already in database, user is unable to insert same line. so I am showing message box.
after clicking on OK on message box,
I want all column values to be auto populated from database table.