Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bookmark/recordset issues

Status
Not open for further replies.

poporacer

Programmer
Oct 2, 2007
53
US
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.
 
it was always one item forward of the data
Check the value of the BoundColumn property of cmbCDC.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The bound column is 1, is that what it should be? Any other ideas on why I am getting the error message?
 
How are ya poporacer . . .

Instead of using the [blue]RecordsetClone[/blue] property & bookmark, try the [blue]Recordset[/blue] property:
Code:
[blue]Me.Recordset.FindFirst "[ID] = " & Me.cmbCDC[/blue]
Should be all you need! If the ID is not found, nothing happens . . .


Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top