I have a database with 2 tables. One table is the specifics for a person. The other table is for tracking incidents with these people. I have a form (frmEdit)that has a combo box with the person's ID in it and you select the ID and the form should populate with the data on that person. The first problem I have is I use this code to update the form:
Me.RecordsetClone.FindFirst "[ID] = " & Me.cmbCDC 'Combo box with ID
Me.Bookmark = Me.RecordsetClone.Bookmark
rs.FindFirst "[ID] = " & Me.cmbCDC
rs.MovePrevious ' I had to put this in because it was always one item forward of the data
'The next code enters the data to the form from the recordset.
txtName = rs.Fields("Name")
txtEthnic = rs.Fields("Ethnicity")
txtDOB = rs.Fields("DOB")
If you select the first Person in the list, the form populates properly. If you choose any other person you get an error that the value entered is not valid for this field.
Me.RecordsetClone.FindFirst "[ID] = " & Me.cmbCDC 'Combo box with ID
Me.Bookmark = Me.RecordsetClone.Bookmark
rs.FindFirst "[ID] = " & Me.cmbCDC
rs.MovePrevious ' I had to put this in because it was always one item forward of the data
'The next code enters the data to the form from the recordset.
txtName = rs.Fields("Name")
txtEthnic = rs.Fields("Ethnicity")
txtDOB = rs.Fields("DOB")
If you select the first Person in the list, the form populates properly. If you choose any other person you get an error that the value entered is not valid for this field.