Main Form Running A Search On Subform

Sep 20, 2012

I have only 1 table that im 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:

1 Table

ID : Autonumber

ProblemType : Text
Technician : Text

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?

View Replies


ADVERTISEMENT

Forms :: Main Form And Subform Search For Same Record

Nov 20, 2014

I am currently working on a project in access 2010 and I am having a search for record dilemma. I have a main form that has a subform in it under a tab control. I place a search box at the top of the form so that user could select either the ID, the internal case number, and/or the reviewer name in the text boxes to search the record.

I have tried the using the search for record macros and the convert the macros to VBA and possibly write so extra coding for calling the subform into the search but nothing seems to work in getting the search in sync between the main form an the subform. VBA code that will look for same record in both forms.

The reason for the tab control is because depending on the data entered the users switch between mid section data about case and so one set of info goes into one tbl and the other goes into another, but the subform that I am referring to in this question is being generated from the same tbl as the main form.

View 2 Replies View Related

Modules & VBA :: Unable To Search A String Within Subform To Find Information Stored On Main Form

Dec 2, 2013

I'm trying to search a for string within a subform to find information stored on the mainform to which the particular subform belongs.

The problem is that the subform is generated from a query which uses a number from the main form to generate.

So the subform record is only generated when the correct mainform record associated with it is loaded.

Now to solve my problem I've made a new query that brings up ALL the results that could be generated by the main form and from that I can search to find my search term I'm after and read off the ID number to tie it back to the mainform.

But all of this is done manually, I want a way to do all this using VBA in a way that the user can't edit any records as they are doing it.

View 3 Replies View Related

Why Is Main Form Update Event Triggered When Subform Dirties Main Form?

Dec 1, 2005

I have a subform which makes a change to a field on the main form. When focus is returned to the main form, the BeforeUpdate and AfterUpdate events fire. Why? I thought from the form's perspective, the subform is just another control.

BTW, I get the same behavior if I modify the field from within the Exit event of the subform control.

In either case, the main form's Dirty event is NOT triggered.

View 2 Replies View Related

Keeping Focus On Main Form While Queries Are Running

Jul 23, 2005

I'm sure there is a simple solution - but everything I have tried hasn't worked.
I have a command button on my main form that opens up a popup form. On the popup form the user makes various selections and clicks on another command button(on the popup form). That button is linked to a macro - that runs several queries.

The problem I am having is when the macro starts to run - the main form is maximized again (so now it doesn't take up the full screen - just a part of the screen) and some of the queries start flashing in front of the form.

I know how to maximize the form once the popup form closes - that's not a problem. I just cant figure out how to keep the focus on the main form and in front of all the queries as they are running.

View 2 Replies View Related

Replacing Running Total From Subforms Control To Main Form Table Field

Jun 11, 2015

I have an access form (Customer) along with a sub-form (Work_done). On sub-form I have Running sum of Amount in Text box-1. I want that Total of Running sum be replaced with Main form's tables field total_amount. Is it possible that we can replace an amount of control of sub-form into main form's field?

View 1 Replies View Related

Requery Subform From Another Subform Both Connected To Main Form

Aug 8, 2014

I have a main form that has two subforms, subform1 and subform2, both connected to the main form. When I enter data into a field in subform1 I want subform2 to requery and update to show the calculated results from the new or changed data in subform1.

I found that if I do a refresh it works when changing the data but not when entering a new line of data in subform1. I tried some code in the after update field of on subform1, but cannot seem to get anything to work.

Me.[subform2].Form.Requery

Does not work. It errors and says it cannot recognize subform2 as a field. I have tried a field name on subform2 but I still got the same error.

View 1 Replies View Related

Forms :: Adding Search Option In Main Form

Jun 25, 2013

I have two tables called "tblFundingBodies" and "tblGrants". I have a form that allows me to view all the records for each of the funding bodies. By this I mean, it shows information on a funding body but to see information on the next funding body, I must click on the next record button. Just wanted to clarify that it isn't in the form of a table.

This form also has a subform in the same format that shows each of the grants that funding body has provided. When I select the next record from the main form, it will show me the grants from the company in the next record. The field that has the funding body is a text box.

I want to be able to add a seach facility to the main form that allows me to search for a funding body and get back exactly what I have described above, but just the details on that funding body/grants. In other words, I want the form view of the funding body I search for with the sub form of the grants from that funding body, not in the form of a table where you can see them all at once, I want to be able to click through each grant in the sub form.

View 6 Replies View Related

Modules & VBA :: Input Box Search - Find A Record In Main Form

Jun 5, 2014

Input box Search problem. I have been using the following to find a record in my frmMain using an Input Box:

Private Sub cmdClientIdSearch_Click()
'Searches for Client by ID number
Dim rs As Object
Dim strCriteria As String
strCriteria = InputBox("Please enter Client ID" & vbCr & "Do not type leading zeros")

[Code] ....

It works great if I run it from a command button from frmMain. But, if frmMain is open and I run it from a command button on my switchboard, I get the following error message:

Run Time error 7951. You entered an expression that has an invalid reference to the Recordset Clone Property. I tried inserting a command to open frmMain in the first line, even before the two Dim statements, but I get the same result.

View 6 Replies View Related

How To Search Sub Form Records From Main Form?

Nov 12, 2006

The situation is like this:

I am designing a db for a dental clinic. I created 3 tables as follows:

1.T_Patients (P_Code(PK) and other fields)
2.T_Diagnosis (P_Code(Fk), ToothRecId (PK) and 32 text fields for 32 tooth named (UR1 to UR8, UL1- UL8 for Upper left / right Arch and LR1 to LR8, LL1 to LL8 for Lower left / right Arch)
3.T_Pmts (P_Code (FK), PmtRecId(PK) and other fields

I created one main form based on T_Patients tbl and similarly another 2 forms from other 2 tables. In the main form I placed 1 sub-form and 2nd sub-form. Bothe the sub-forms are Master / Child relationship on form over P_Code field in the main form.

Single character length has used for all the 32 text fields in table T_Diagnosis. So only one single B, C, D, F, M could be entered.

Normally we search patient’s profile by patient’s code or by name that displays in the main form. But the client needs to search patient’s record by tooth criteria.

There may many tooth fields in the first sub-form that are null and only some of them with any one of the B, C, D, F, M character. Bcz there is very rare chances of damaging all 32 tooth of the patient.

Now my clients want to search based on the data which are B, C, D, F, M characters. Means once he types C (stands for Cavity) in a search text box then it should bring all the sub-form records that hold value C in any of the 32 fields.

1.How can I do this when the search based on SUB-FORM and not over the main form?
2.The entered criteria value might by in other field also. Like say if entered C then this value may be in any of the 32 fields. So how it would bring all records?

I am confused how to do it. I attached a pic of my form for your ready ref. :confused:

I would really appreciate if somebody could help me.

With kind regards,
Ashfaque

View 3 Replies View Related

Get Subform's Control In The Main Form.

Feb 21, 2005

Lets say I have Form A and Subform A with the parent-child relationship established that works well. Subform A has a Text box control that is getting display when I include the subform in Form A.


Now, I decided I dont want to include subform A in the Form A. Is there a way for me to show the contents of that Text box control in Form A without attaching the subform in the main form (Form A)?

I read somewhere that to refer a control on a subform, I have to use the code - Forms!mainform!subform.form!control. But this would be in VBA. What is the equivalent of this in a Control Source in the main form?

If I have not explained myself correctly, please do let me know.

To summarize, my question is without including the subform, I want to reference the values of the subform in the mainform. (I have some design necessity for this requirement) Is there a way for this?

thanks!

View 1 Replies View Related

Returning To Main Form From Subform

Apr 25, 2005

Hi,

I've a form that has 2 subforms - which subform is used is dependant on the selection of a combo box in the main form. After much time spend trying to set this up I am happy to report that this section works fine.

My problem is that when I have completed the subform I am not able to continue tabbing through the rest of the form.

Any help would be great,

thanks
Barry

View 1 Replies View Related

Tabbing From A Subform To Main Form

Jun 29, 2005

everytime i try to tab from my subform, it creates a new record for that subform. Also, about the subform, the control that links the main form and sub form is unique.
I have now set my Cycle property on my subforms and forms to Current Record. How can I tab from the subform to the main form and vice versa?

Thanks!

View 1 Replies View Related

Main Form Update To Subform Value

Sep 2, 2005

hi

i have a main form, which has a subform (subform1)

subform1 has a further subfrom (subform2)

in the subform2, i have a value, which on a double click, i wish the main form critical value to refresh to

thereby the main form refreshes to the value of the subform 2 value

i cannot work out the code, you may have guessed from the description of the question, i am a bit of a novice.

could anybody assist, please

View 2 Replies View Related

Main Form And Subform Issue

Oct 21, 2005

Hi, I have this main form, "frmMainPatient" and I am trying to add in another Main form "frmFim2" as a subform into frmMainPatient. I am running into some issues. Can someone take a look and tell me what I am doing wrong. Thank you,

View 2 Replies View Related

Filter Main Form From Subform

Nov 16, 2005

I have a main form that contains basic project information, and one of many subforms that contains project manager and contract information. (forms and subs linked by project ID) My project managers want to have the ability to only show project records that are theirs. I can make a filter based on any field in the main form without a problem using code like below.

Dim strFilter As String
strFilter = "ILFID Like '*FME*'"
Me.Filter = strFilter
Me.FilterOn = True

How do I write a filter to reference the project manager field in a subform that will actually filter the main form and subform records?

Thanks!

View 7 Replies View Related

Tabbing Between Main Form And Subform

Nov 18, 2005

Hello all,

This is my first post to these forums, however I have leeched so much information off of all you guys that I can't even begin to express my gratitude. So, now, onto my problem...
I'm developing a form for our call centre people to enter information regarding customer returns. Customer orders are placed on one of two systems. In my form, when the person is entering info, I have a drop down box to choose between the two systems, which calls up a respective subform to enter system-specific information. The problem I have is that I can use tab to enter the subform, however I can't use it to get out. There are two records in the subform - order date and order number. After I enter info into these 2 textboxes and try to tab out, it seems that the subform goes to a new record. How can I get my form to tab into the next required field on the main form? Hopefully this makes sense, I just read through it and its kinda questionable. Thank you very much in advance.

View 1 Replies View Related

Query Subform From Main Form

May 11, 2005

I have a main form with 5 fields (I'd like to be able to use any number of them) that I want to use to run a query against that is contained in a subform. What is the best way to go about this?

View 1 Replies View Related

How Do I Link A Subform To The Main Form?

Oct 24, 2005

Hi,
I have set up a database for my company which holds records to all the companies that we have as clients. I have created a main form and a subform. The main form is where all the particulars of the companies are entered, and the subform is like a preview window of the companies. By right, when i click on one of the records in the subform, it should reflect in the main form, enabling me to add on additional information using the fields in the main form (i have some features in the main form that should be used to record the informatio), but I just do not know how to go about doing that. is there a way to link the subform to the main form, such that when i click on the past records in the subform, it will reflect on the main form for me to edit? Any help is appreciated.

View 6 Replies View Related

Forms :: How To Get Main Form With Subform

Sep 27, 2013

i have a main form for customers and a subform for sites which is set to locked so its displayed as just a list. I have a button on my main form to add a new site for the current customer displayed..How can i get the Main form '1CustomerDetails' with subform '2SiteList' to automatically refresh one i've clicked the save button on another form.

View 1 Replies View Related

Subform Query On Main Form

Dec 3, 2014

I have created a 1 to many database. One employee table with personal details and then tables reflecting costs like, flights, accommodation, visa costs etc.I then created a query(total costs) to add up the total of those tables and then a subform that I inserted in the main form that just display the total over cost.

When I click, new record, everything goes blank which is perfect for me to input a new record but the total of the 1st record( i only have one record at the moment) remains the same.

View 8 Replies View Related

Combo Box Synchronization Between Main Form And Subform?

Jul 17, 2005

I have a main form with a subform. On my main form, I have a combo box set to "find a record on my subform, based on what I select in the combo box." This works great! At the same time, I want to use this main form combo box to synchronize with a combo box in the subform to display a value based upon the value selected in the main form's combo box. I have tried several things and searched Access newsgroups without success. I am using MS Access 2002, producing an Access 2000 database. Has anyone got any ideas? I could really use some help. Thank-You.

Denny G. :confused:

View 5 Replies View Related

Procedure Behaves On Main Form, But Not On The SubForm

Jul 25, 2005

I have a form with a subform and on the form and also on the subform, I have three comboboxes or txtboxes and in the OnExit event I have a little procedure which makes sure that each have been filled in or it asks if you want to cancell and if yes, it setfocus on the cmdCancell and then I can canells the records, and the procedure looks like this:
Me!QCTypes_Label.ForeColor = 0 'Change Label Color to Black
Dim Response As VbMsgBoxResult
If Len(Nz(Me.QCTypes, "")) = 0 Then 'If QC Type is Blank
Response = MsgBox("No QC Type Was Entered," & vbCrLf & "Do You Want to Cancel QCA.", vbYesNo + vbDefaultButton2, "No?")
If Response = vbYes Then
Me.cmdCancell.SetFocus 'SetFocus on cmdCancell
Exit Sub 'Exit Immediately
Else
Me!QCTypes_Label.ForeColor = 33023 'Change Label Color to Orange
Cancel = True 'Re-Enter QC Type, same field
End If
End If
Now the main form works great, but the subform acts strange, when I select YES, instead of cancelling and closing like the main form, this one does each procedure for each of the other two procedures. Why does it work right on the main and not on the subform? Thank you in advance for any assistnace rendered. :eek:

View 14 Replies View Related

Creating New Record In Main Form From Subform

Aug 4, 2005

Hi,

I want a user to be able to create a new record in the main form, after they have finished filling in the boxes in a subform by pressing the Enter key, rather than having to click the 'new record' button on the main form.

I reckon I need a 'default button' on the subform but I have no idea what this should do when clicked to create the new record...

View 1 Replies View Related

Locked Main Form - Validate 1 Subform With Another?

Oct 24, 2005

I have a main form that has 3 fields. They are all locked fields, only to show the user the "person" record that they are looking at. They update to subforms on a tab. The first subform is activities (like from a mailing - received return no forwarding address, received updated address, called us, etc)

The other subform is for addresses, original and updated.

There is a date field for the date of any updated addresses.

What I need to do is allow users to enter activities and move around from main record to main record. The important thing is that if they enter an activity on the subform that is for receiving an address change, I need to make sure that they do not leave the main record, without entering in an updated address for that same date, on the address subform.

The activity subform has a date field too, so the validation part seems like it wouldnt be too hard...

IIF ?subform-activities-field-activitytype = "updated address" (3/code to lookup table) AND ?subform-address-field-date = grrr this is where I get confused.

Then msg "Stop, you must add the updated address for the activity of receiving an address change"
cancel = true

end if

make sense?

Any help would be gratefully appreciated!

View 4 Replies View Related

Filter Subform From Main Form Combobox

Jan 9, 2006

I have a main form with an unbound combo box. I also have a subform showing records in datasheet view.on the after_update event of the combobox I want to filter the subform. Here is my code (note frmqrysubmittals is the subform and the recordsource for the subform is initially the RS1 portion of code):Dim RS1 As StringDim RS2 As StringDim RS3 As StringRS1 = "SELECT tblSubmittals.SubmittalID, tblSubmittals.Format, tblSubmittals.[Specification Section], tblContractorInfo.Contractor, tblSubmittals.[Project Number], tblSubmittals.Description FROM tblContractorInfo INNER JOIN tblSubmittals ON tblContractorInfo.ContractorID = tblSubmittals.ContractorID"RS2 = " WHERE (((tblContractorInfo.Contractor)=" & Chr$(34) & Me.cboContractor.Value & Chr$(34) & "));"rs3 = RS1 & RS2Me.frmqrySubmittals.Form.RecordSource = rs3me.frmqrySubmittals.form.requeryWhen I update the cbo box the subform doesn't display any records. When I go to design view and look at the record source it displays the RS1 portion (the original RS), but all of the terms are placed in brackets []. Note, the subform and contorl are both named frmqrySubmittals.I've been at this for days. What am I doing wrong?Thank you everyone for your help. This group has been a great resource over the past few months as I stuble through learning Access.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved