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

Create a search tool on a form

Status
Not open for further replies.

Allilue

Technical User
Sep 14, 2000
189
GB
Hello,

Can someone help me - I'd like to create a search tool in my form to locate a specific file (unique identifier FileID). Where do I start? Can you point me into the right direction please... I just want a field where you type in the identifier and then press a button Find to locate the record.

Thanks,
Allison
 
Create a textbox call it TxtWord create a command button and attach the following. You will need to change the path. This is rough but it works. It also gives you an idea to start with.
Dim WordDoc As Object
Dim oApp As Object
Dim MyPath As String
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
MyPath = "C:\my documents\" + Me.TxtWord + ".doc"
Set WordDoc = oApp.Documents.Open(MyPath)

 
Sorry - let me rephrase...
I have a subform within my main form that lists records from a query. i'd like to put a search tool on the main form to look up a record in the subform. However, the search box needs to be typed in manually to match the record id to find the correct record. (sorry i used the work document...)
Thanks for the response!
Allison
 
Try the Command Button Wizard,Record Navigation,Find Record.
 
Thanks - How would you link the query and record number to the search field then? Does this make sense?
 
Just wanted to add another piece of info:

Essentially i want the search to be similar to a combo box, but with the ability to enter in a value that needs to link with a field in the underlying query.
 
How about using a combobox with the Rowsource tied to a query that retrieves the FileID.

Set Limit to List to Yes

As you type in the Combobox it should cycle through the list.

I'm not clear on what you want to do once you've got the correct identifier.

Do you open the record in another form

Need to Filter the Sub-Form to show only that record

Either way, you can create a query that takes your value and set the forms source to that query or look into "form fitler" where the data in the form is filtered down based off you filter value
 
Thank you. I think this will work...

The only other thing is that in the query the FileID is retrieving from, there is a field where it's necessary to enter a Date [forms]![SalesForecast]![SelectDate]. If the user is choosing to Find a Record based on the FileID, I'd like the SelectDate to default to all Dates.

If they do not choose to use the FileID finder, then then have another combo box i already have in place that let's them view all records given the selected Date.

I'm just putting the Search ability so that there is another choice if the user does not know the Date the record falls under.

Thanks!
 
In the criteria cell of the SelectDate column in the query grid:
=[forms]![SalesForecast]![SelectDate] OR [forms]![SalesForecast]![SelectDate] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top