Need some help with a Search Box and an event based on the selected result.

FoxRocks

Registered User.
Local time
Tomorrow, 01:52
Joined
Apr 24, 2012
Messages
35
Hello,

I am trying to add a Search Box to my form that once it shows the result, you can select that result and have it bring you to that particular record. My form is based on a table that I've created for tracking defects. I would like to be able to search the defect database by either the work order number or by the aircraft identification. Once I find the record I'm looking for through the search, I would like to be able to select that search result and have it bring me to that defect record. The idea is that I need to go back to update the status of the defect and I don't want to have to scroll through all of the records to find just one. Does that make sense?
I've searched on this site for something that will work, but I haven't found a solution that covers the second part of the problem, only on how to create a search box.

Thanks in advance for any help you can give.

~FOX~
 
This is how I Would approach the problem.

Three forms
Search Form to filter the records
Defect List - multiple records (OnClick to Defect Entry)
Defect Entry - single record

Code:
Function DefectSearchCriteria()
    With CodeContextObject
        If IsNumeric(.[Search]) Then
            .[Search] = "W"
            DefectSearchCriteria = "[WorkOrder] = " & .[Search] & ""
        Else
            .[Search] = "A"
            DefectSearchCriteria = "[Identification] = '" & .[Search] & "'"
      End If
    End With
End Function

Function Open_DefectList()
    With CodeContextObject
        DoCmd.OpenForm "DefectList", , , DefectSearchCriteria, , acWindowNormal
            End With
End Function

Function Open_DefectEntry()
    With CodeContextObject
        DoCmd.OpenForm "DefectEntry", , , "[WorkOrder] = " & .[WorkOrder] & "", , acWindowNormal
    End With
End Function
Simon
 
I am not 100% sure what you require . If you just wish to find and open a record with either the order number or AC ID Then a cmd button and a search field would acheive that. I am assuming the order number is Numeric and the a/c id is not Numeric. If I have understood you correctly, i can send you my suggestion for the code for the on click of the cmd button .
Bob
 
There is a wizard in Form design that does this for you.

Look at Combo Boxes and follow the steps.
 
I was also searching something like this but still could not make out the solution.

I made a simple form that was used as data entry in a table and then I made some simple reports.

It is a plant maintenance dB and operators report the breakdown request via this form. Till now it was simple. Now when the request is physically closed, I want to close that particular request by entering some information such as spares used, their cost etc.

In my attached .jpeg, the "request entry" block is that simple entry thing. Now i added tblCosting and tblMaterials. I am thinking to use MRPK as a foreign key in tblCosting, so that when I Populate tblCosting by using some kind of form, I could link this data to a particular request.

Please advise me broad guidelines how to go further.
 

Attachments

  • Relationship.jpg
    Relationship.jpg
    91.2 KB · Views: 88
Where exactly is your problem.

I am a little confused with you last post.
 
Just now, I could find something.
I used a combo in header to find a particular record and then I inserted a subform linked with main form. Hope, this should work.

but still advise if there are some tricks.
 
You will find better and more complex methods in the fullness of time.

For now you have a solution.

Good luck with the project.
 

Users who are viewing this thread

Back
Top Bottom