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!

Creating a Search Form (Access 97)

Status
Not open for further replies.

PB

Programmer
Feb 24, 2000
1
US
Hello -<br>
<br>
Looking for help. Please e-mail me reply at &quot;<A HREF="mailto:patb973@aol.com">patb973@aol.com</A>&quot;<br>
<br>
Background: I've created a database to track a teacher's books. The Main form is &quot;MyBooks&quot;. That database links to table &quot;All&quot;. I have also created a Form &quot;BookSearch&quot; so that she can search by either (1) last name, (2) first name (3) book category or (4) applicable holiday. The search function works fine, and a datasheet listing all of the relevant records is displayed.<br>
<br>
The Problem: There is an option &quot;Book Details&quot; that she SHOULD be able to click on to goto the record in Form &quot;MyBooks&quot;. However, when you select Book Details, the database opens a blank form &quot;my Books&quot;.<br>
<br>
The Primary Key for All is an autonumber named &quot;ControlNumber&quot;.<br>
<br>
Please help. Thanks.<br>
<br>
-Pat
 
Well to sync one form to another you can use this code<br>
<br>
Dim FormName As String, SyncCriteria As String<br>
Dim f As Form, rs As Recordset<br>
<br>
' form name to be syncronized<br>
FormName = &quot;MyBooks&quot;<br>
<br>
'Define the form object and recordset object for the MyBooks form<br>
Set f = Forms(FormName)<br>
Set rs = f.RecordsetClone<br>
<br>
' define the criteria used for the sync<br>
SyncCriteria = &quot;[ControlNumber]=&quot; & Chr$(39) & Me![ControlNumber] & Chr$(39)<br>
<br>
' find the corresponding record in the All table<br>
rs.FindFirst SyncCriteria<br>
f.Bookmark = rs.Bookmark<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top