Wild card search display in subform.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H

I am a complete novice at Access so forgive the (hopefully) simple request

I have a table that has only 3 fields, the Primary key being an auto number. The other two fields a re description and Report

Basically, Description is a detailed description of a certain report, the name of which is held in the report field. I have created a form with a text field (unbound) and a button. There is a subform (datasheet) which basically a form view of the table

This currently shows all records. I would like to be able to type in a partial description in the Text field using wild cards, press the search button and have the Sub Form only show records where the partial description is somewhere in the description field of the table

As much information as possible on this would be very much appreciated as I am not sure if I have the properties for the forms correct

By the way, the Form is called Report Search, the sub form is called Report_Table and the table is called Report_Tabl

Many thank

Malcolm
 
Leave your main form as it, but note it does not have to bound to a table or query, infact better if it is not. Rather than liking you subform with a master/child firls relatioship you can add a criteria to the source of your subform

e.g
Master form called frm_Maste
Sub form call subfrm_Su

In the design view of your sub form click the elipsis button (...) next to the Record Source property in the Properties window. This will open a query view to act as the sub form source. Add the table to this query and write your criteria for the description field but also include reference to the form (Like "*" & Forms!frmMaster!subfrm_Sub!Description & "*") with Description being the name of the text box control on the master form. Close the query view and the close the sub form. Open the master form an in the click event for you button use the following code (Me!subfrm_Sub.Requery). This will requirey the sub form and so forcing it to find records uner you criteria

This repsonse is difficult to detail in a form and it is best viewed by example. If you wish I can send you an email with an example database
 
Back
Top