I connected Infopath to a SQL database. I created a repeating table with the first field (PIN) containing the employees ID number. The employees ID number is suppose to populate the other fields such as first name, last name, etc. The problem is that when I enter an Employee ID with a greater number value it copies the first name, last name, and etc. from the previous fields. For example, if I type 28620 in the first row I will get the correct information. If in the repeating table I type 28619 I get the correct information but if I type 28621 it will copy first name, last name, etc from 28620's fields. How can I fix this problem? Another problem I have is the database has all the employee ID's with 5 digits. Some employees have four or less digits. In the database these ID's will have zeros in front. How can I automatically add zeros to the employee ID field (PIN) if the employee ID is not 5 digits long?