Topics Search

Search Main Form Based on Contents in Subform

Search Main Form Based on Contents in Subform
Views: 18
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:

Similar posts...

 

search a subform field from a Search tab on the main form

search a subform field from a Search tab on the main form Icon
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

Search as you type question Icon
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

Main form running a search on Subform Icon
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

Saving record on subform Icon
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.
 

Text box based on combo inside subform

Text box based on combo inside subform Icon
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.
 

Referencing Controls on Forms

Referencing Controls on Forms Icon
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
...
'Me!Subform1.Form!ControlName
'Me!Subform2.Form!ControlName
'Me.Parent!ControlName

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.
 

Filter Subforms via Main Form Date Range Entry

Filter Subforms via Main Form Date Range Entry Icon
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
 

Subform value in main form - error 2113

Subform value in main form - error 2113 Icon
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
 

saving subform data into table

saving subform data into table Icon
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:
 

After adding data on subform

After adding data on subform Icon
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