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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

always edits the 1st record

Status
Not open for further replies.

vanti1

Technical User
Apr 11, 2001
6
IE
book = Form_Form1.Text16.Value
rs.FindFirst "(coursecode) = '" & book & "' "
rs.Edit
rs("coursecode") = Form_Form1.Text16.Value
rs.Update
rs.Close


i have a subform(datasheet) on the left on the right i have text boxes (linked to subform)
i'm trying to edit the value of a record in subform using the text boxes.
but if i change the value of the text box it always edits the 1st record i want to edit the selected record
hope you can make sense of this
thanks as always
mike

 
Hi Mike,
Not saying that the code is wrong, more, that I write it a little different:

rs.FindFirst "coursecode = '" & Me.Text16 & "'"
rs.Edit
rs!coursecode = Me.Text16 '?
rs.Update
rs.Close

Then as I look at this I see that you're asking to find something where the coursecode is x, so you can edit its value to be x. I think somethings a little crossed up. :)
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top