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

opening a new record within a text box feild

Status
Not open for further replies.

oggstar

Technical User
Sep 8, 2001
18
0
0
AU
I am editing a form and the curser is within the Feild [number] (Say 1500 is entered). If i change the number to 1600, how can i set the database so the record relating to the number 1600 appears, as opposed to the information relating to 1500 record remaining with the new number 1600 appearing in the field.

Any ideas
 
create an unbound text box. It has to be unbound otherwise your record will get updated. On the after_Update of the text box place this code.

dim rs as object

Set rs = Me.Recordset.Clone
rs.FindFirst "[fieldName] = " & textBoxName
Me.Bookmark = rs.Bookmark

This should hopefully work,

Nick
 
Thanks nickjar2 for teh reply
Still unsure about the code to use, specifically what does & textBoxName refer to.
I thought it refered to the feild name but that was unsuccusful.

This was the code i included, - " & textBoxName

Private Sub Site_Number_AfterUpdate()
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Site Number] = " & textBoxName
Me.Bookmark = rs.Bookmark
End Sub

Thanks
 
oggstar,

Sorry. I didn't explain properly.

Private Sub Site_Number_AfterUpdate()
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Site Number] = " & site_number
Me.Bookmark = rs.Bookmark
End Sub

Hopefully this will work.

Nick
 
Thanks nickjar2 it most certianly works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top