Search Main Form Based on Contents in Subform

I am trying to get the search field [contents] in my DataEntry form to work. I want it to search all the contents and show the only the records that have those contents in the main form.

The main form shows all the boxes. I originally just added the [BoxContents].[Contents] field to the main form and sorted the query based on what was entered in the text box.

The problem is there can be multiple content records for each box so it shows the same box over and over again depending on the amount of contents.

Sponsored Links:

Related Topics

search a subform field from a Search tab on the main form
I have 1 main form (USER) and 3 subform ( ASSET, INVOICE, LO) which related together. I need to create search button in a main form that only can search ASSET_ID. it means find the record through subform. how can I do that?

Search as you type question
I have a search form which has the SEARCH AS YOU TYPE function.

Now when I double clicked on to the searched item, it will show me the main form with the information that has been saved including the subform but it does not take me directly to the specific record in the subform.

For instance, In my main form, I have an option to choose A.M., LUNCH or P.M.

Accordingly, whichever one I click, it will be visible as a subform. For example, if I click A.M., the A.M. SUBFORM will be visible. If I click LUNCH, the LUNCH SUBFORM will be visible and the rest hidden.

How do I link subform to the search form so that if I click on to MR.A’s form for LUNCH time only, it will open up the main form with LUNCH subform.

Main form running a search on Subform
I have only 1 table that I'm working with I simply want to have a form that runs a search on one of the fields and returns the results.

This is what I have:
I want to create a form that has a main form with a text field that I can input a string of text and run a search on the problemtype field. And return all the results in the subform with based on keyword that was inputed in the form above.

I want the results to display Problem type and Technician fields. What is the best what to do this?

Saving record on subform
I have a subform connected to a main form. The subform is a tab form with a one to many relationship. The subform directs data from one of the fields in my subform into another hidden field in the record.

it is based on an if then statement based on a field in my main form. THe problem is that the code will not recognise the information in the subform until I leave the main form (or it loses focus) and come back.

Then my code works fine. I've tried DoCmd.RunCommand. AcCommandRecordSave and that didn't work.

Referencing Controls on Forms
I have a main form, 2 sub forms, and 2 text-boxes on the main form. I have a search box now for the first subform. Works perfectly. Once the users filtered based on name, I want them to be able to select that filtered record which would filter another subform.

My first attempt was to assign the ID that was selected to a textbox on the main form, then automatically requery the second subform based on that value. I used this way on my search box. I'm sure there is a way to go directly from clicking the value to requerying the second subform, but I don't know it. If you do,

That being said even the indirect first attempt isn't working. It all has to do with the ".", "!", and ordering of this stuff. I'm not sure what . and ! mean. Cananyone explain them, It has to do something with Parent child, but beyond that I'm at a loss.

Me.[Collateral] = Acct_Reference_id
Me.[Navigation]![textbox] = Acct_Reference_id

I did find this very useful site [LINK]. It shows what code you can use depending on where you are and what you're doing. Even with that as a resource, I'm still at a loss.

Text box based on combo inside subform
I have a subform located inside my main form. The subform is linked to the main form so the data shown in the subform matches the main form.

I have added a combo box to the subform and I'd like to have it populate the fields in the subform, but still have the entire subform linked to the main form.

Subform value in main form - error 2113
I'm trying to use the contents of a subform to populate the value of a textbox on my main form. I'm in my main form, I have a tab control that contains a subform control. In the OnChange tab I code the following:

CounterClaim_Appl.Value = Me!subfrmRep_Resp1.Form!ContacT.Value

me = mainform . subfrmRep_Resp1 = subform control . Contact.Value = contents of that field (I'm thinking)

I'm getting an error 2113 - Value entered isn't valid for this field, do I need to reference the tab control

Refresh the contents of a subform whenever the record in the main form changes
In Access 2003/XP/2000/97, how do I refresh the contents of a subform whenever the record in the main form changes?

Search Box Requerying Subform problem
I'm trying to build a text box to filter a subform. I have the main form "Navigation", the subform "Loan Search subform" and the textbox "Search"

When I run the Loan Search query with Search populated, it filters and works correctly. When I try to have it requery automatically, it doesn't seem to.

I have tried every combination of

Forms![Navigation]![Loan Search Subform].Requery
Me![Loan Search subform].Form.Requery

that I can think of. Some throw error messages. but no requery occurs.

Searching a Subform
I have an access database with a main form which is the people_tbl and a subform which is called the TanfActivity_tbl and the childrens_tbl. The users and myself are unable to do a search in the subforms, is there some way I can make it so that the users can search fields in the subforms as well as the main form. For instance the TanfActivity_tbl has dates that they need to search a persons Activity by. Is there some kind of code I can use to do that?

Filter Subforms via Main Form Date Range Entry
I have a form that has a subform which is based on a query, not linked to the main form. Here is the query:
What I want to have happen is on two unbound text boxes allow users to enter a date range and have the subform filtered to only show records of the date range entered in the main form boxes.

Main Form: VoucherMain
SubForm: VoucherDetail Subform
Field in Subform to Filter: DateTimeStamp Default Value: =Date()
Fields in Main Form used for Range: BeginDate & EndDate
Button to Apply Filter on Main Form: FilterTrans

how to create a search for box?
Trying to create a search box that searches in my data sheet, In every field (or! Only in a particular field).
Like the default search box in datasheet view form.

I tried to use a macro:search for next record.
It works Only if my data is on the main form! But! My data sheet form is a subform.

And I can not make marco works on a subform. I mean, my text box is on the MAIN form,and I need to search subform.

After adding data on subform
I have a main form based on tbl_Prep and a subform based upon tbl_WorkOrder. Not all tbl_Prep records have a related record in tbl_WorkOrder.

My problem is that when a new record is created with data entered on both main and subform upon "leaving" the subform, a blank subform screen is displayed. How can I prevent this from happening? Note that there can only be 1 record on subform to 1 record on main form but I cannot have a 1 to 1 relationship

saving subform data into table
I have a main form [Emp_New] and a subform [Class_Catalog subform] my save button is on the main form. When I click save it saves the values in the controls on the main form to the Emp table it is based on.

Problem is the subform. It is based on the value in a the txtJobtitle control on the main form which is great. From that value it pulls Class_ID (a text box) from a table named Class_Catalog.

It also has a field that simply copies the Emp_ID field (a text box) from the main form. I need the subform to save the Class_ID and Emp_ID into theClasses_taken table when the main form save button is clicked.
Here are the control sources for the controls in the subform:

How to create a search for box?
Trying to create a search box that searches in my data sheet, In every field (or! Only in a particular field).
Like the default search box in datasheet view form.

I tried to use a macro:search for next record.
It works It works Only if my data is on the main form! But! My data sheet form is a subform.

And I can not make marco works on a subform. I mean, my text box is on the MAIN form,and I need to search subform.

Turn form into search form
I have a patient entry form with multiple tabbed pages and subforms so it is pretty extensive. I need to turn this exact form into a search form so that the user can enter any data in they want and leave any of the fields blank and it will search the records based on the fields that were filled in.

I then want the matches to appear in a subform that lists possible matches below the search criteria.

I would really like to just duplicate the form I have now and make changes to it to turn in into a search form so I don't have to rebuild a form from scratch. Is there a way to do thiswhere I just add a button that when clicked will populate the subform based on any of the filled in fields from the form (again, this has multiple forms within it with fields from multipletables)?

Subform field to be not visible if main form field = "No"
I have a main form called frm_MainPage and a subform called frm_CurrentClaims. The 2 are linked by fld_ClaimNumber & fld_SubClaimNumber (Child/Master).

All I want to be able to do is make a field on the subform fld_SubEscalatedTo 'not' visible when main form fld_EscalatedYN = "" or "No"

Some fields on the main form are the same as the subform fields because the subform is linked to excel spreadsheet. The subform sits exactly over the same fields of the main form so that it appears as though it's part of the main form.

The main form fields hide/display perfectly based on the fld_EscalatedYN, but for some reason I cannot get this to do the same thing for the subform field.

I have completed everything else in this database and it's driving me nuts

Multiple combobox to filter subform
I'm trying to filter a subform based on 4 comboboxes in the main form, which are:
Zip Code

Basically, I want to search mother's based on these 4 comboboxes, so that the subform would show the filtered mom.

However, I've working on these for like 1 week and it's getting me no where!

Export subform results to Excel
I have built a main form that includes controls to filter/search records from a subform based on a query. The query pulls data from multiple tables. I want to create another command button in the main form to export the filtered results from the subform to an excel spreadsheet. I have the following code but it pulls all of the data from the query, not the filtered results.

Private Sub cmdExcel_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "q_Server_Data", "c:\temp\test1.xls"

End sub

How can I change this to include only the data from the filter/search in the subform?

Search Main form from sub form
I have a customer form. The main part of the form (customer) has the basic information about the company. It has a subform with the various addresses on it. This all works fine (very basic).

I have another subform on it (company_list) that is not linked. It will list all the companies and their region in a list form going down one side of the form.

What I would like to do is click on the company I want in the subform and it pulls up the record in the main form, but I can't seem to figure out how to do it.