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!

Search Form to Open Found Record in Main Form

Status
Not open for further replies.

bvbowes

Programmer
Oct 12, 2006
21
US
I have created a seperate form that comes up from a button off of my main form which is based off of a query with parameters that can find a record in the database. But now I'd like the ability to have them just click on a button that will open that record in my main form and then close itself.

How can I do that?

It would only need to reference one field, the primary key in the table which is called case_id.
 
Use the recordset of the main form. A very rough sketch of this would look like this:

Code:
Dim rs As DAO.Recordset
'Requires reference to Microsoft DAO 3.x Object Library

Set rs = Forms!frmMainForm.RecordsetClone
rs.FindFirst "ID=" & Me.txtID

If Not rs.NoMatch
  Forms!frmMainForm.BookMark = rs.BookMark
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top