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

Using a "find" in a subform

Status
Not open for further replies.

linwest

Technical User
Jun 18, 2001
1
US
I'm a new access user and use it to manage our archived boxes of files. The parent table contains information of each box such as box number, location, destruction date, etc. The child table contains information of the box contents - names of files, etc. Pretty basic stuff but works great. I've created a form/subform showing all of the information on one page. The main form is the box information and the subform (in datasheet format) contains the names of the files. My problem is using the "find" on the subform. For example, I like to do a simple search on the form for the same file name located in different boxes by finding and scrolling through each box (and of course it doesn't work). You recommended, in a previous question, that the subform must be changed to a link form. Would this apply to my problem. How do I go about creating a linked form?
Thanks for your help - as a new access user your forum is very informative.
 
I wouldn't change anything if I were you, I'd make a query that searches my subform table for a keyword. You could make a form, place a text box on it, and then reference the textbox in your query using the like parameter:

Like "*" & [Forms]![MyFormName]![MyControlName] & "*"

Now you enter in a couple letters, click a button and access opens the query with the data you're searching on. If you provide your email address I can send you a small sample.

Joe Miller
joe.miller@flotech.net
 
This may not be the most elegant way of doing it but I created a unbound combo box which uses a query with the main table ID# linked to the field I wanted to search on. On the after update event I put this code
'******************** Code Start ************************
'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[BatchRecordID] = " & Me![SearchField]
Me.Bookmark = Me.RecordsetClone.Bookmark
'******************** Code End ************************
The user sees the field they want to search on then the code uses the ID# and bookmarks to move to that record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top