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

Search a different table

Status
Not open for further replies.

PharmaFun

Programmer
Joined
Jul 30, 2003
Messages
30
Location
CA
Hello,
I have this code here for searching a table tied to a form, and returning the entry that matches the search number. The code is below. How can I search an entry in a table no linked to the form? I've tried changing "[Number]" to "[Initial Patient Report].[Number]" to reflect the fact that I want to search the table "Initial Patient Report." Any ideas?

Thanks,
Dino

Private Sub cboSearchID_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Number] = " & Str(Me![cboSearchID])
Me.Bookmark = rs.Bookmark
Me.cboSearchID = Null

End Sub
 
Dino,

Remember how you have to present text numbers?

rs.FindFirst "[Number] = '" & Str(Me![cboSearchID]) & "'"



Rollie E

Remeber also troops that if a tip is of value to click the button above that says so.
 
Did you catch the apostrophies above?????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top