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.
I have a form called Add New Delegation, i have combo box of Institution names on the main form and a subform for Agreements discussed. with a combo box called agreements. I successfully cascaded the combo boxes so that the agreements discussed on the subform are filtered by their respective institutions on the main form. However i am unable to refresh the list each time a new institution is selected as the Macro will not allow me to requery a control on the mainform from the subform..
I have two sub forms on a main form.Subform 1 displays information which comes from a query, filtered using two combo boxes on the same form.The active record on the data sheet has two field values output to hidden text boxes on the form.
These text boxes then provide the values used for the query displayed on the 2nd sub form.When I highlight a new record in subform 1, the text box values change, but the values in sub form 2 do no.Which would be the best method to use to get this to requery?
All I am trying to do is get a subform to requery after choosing a name from a combobox on the subform itself, thus updating the records on the subform. The main form name is "BasicTestOneF" the subform name is "ICminiBasicF" and the combobox name is "Combo4"
I have the combobox requery on After Update, but I still get the "Enter Parameter Value" popup. I've spent the last hour and a half just trying to get this simple thing to work and have gone through I don't know how many sites and forum posts, tried every combination of VBA code I've found, and I still can't get it to work.
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.
i have a main form with three sub forms on it. when i update subform 1 i want subform 2 and 3 to update..currently i have an after update event in a combo box subform 1
I need to requery a subform from a third form and can't seem to get it to work.
frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my validation work is done and the new record is added.
However, the new address is not being displayed in the subform.
If I use the command Forms![frmTest]![frmAddress].Requery it works fine.
The problem is that I want to be able to frmAddress on any form, and need to pass the name of the main form (in this case frmForm1) as a variable.
If lsTemp = "frmForm1", the statement Forms![lsTemp]![frmAddress].Requery (and every variation using brackets and quotes that I can think of) fails.
Hi. Having a bit of a problem getting a subform to requery/refresh after running a query from a seperate form. The seperate form is acting as a 'search form' and running query qSearch.
I've tried various things (requery the form, subform etc) but here is the code I'm currently using:
Private Sub RunqSearch_Click() DoCmd.OpenForm "Papers" Forms.Papers.RecordSource = "qSearch" Forms.Papers!Authors.Form.RecordSource = "qSearch" Forms.Papers!Authors.Form!AuthorName.ControlSource = "qSearch.AuthorName" Forms.Papers!Authors.Form.Requery Forms.Papers.Requery DoCmd.Close acForm, Me.Name End Sub
The main form is requerying fine, but the subform isn't. Any help would be appreciated. Thanks
I have a subform in a tab within a mainform. Within the tab there is a button to open a form to delete/add data to the subform. So upon closing this pop up form I want to update the subform to show what has been deleted or added, I have tried the various things to requery the subform but none of it seems to work, here is what I have tried;
I have a form with two subforms. One subform is a datasheet that pulls data from a temp table. During the other subforms Form_Current, the temp table is emptied (DoCmd.RunSQL "Delete from tblAddRefs"), reloaded with data relevent to the current record, and requeried (Forms("frmEDFP").Controls("tblAddRefs subform").Requery). This works like I want it to...
With the exception of the initial load of the main form. The subform based on a table shows (#Deleted) instead of data. if I step through the code, I can see that the temp table is emptied and repopulated by the time I try to requery the subform. This is still happening during the Form_Current of the other subform, which is successfully running on main form load.
If I requery (Forms("frmEDFP").Controls("tblAddRefs subform").Requery) using a button on the main form once it is loaded, the #deleted data is correctly is replaced by regular data, so it's like the requery in the Form_Current event isn't doing anything during load.
I have a main form with a couple of tabs, forms and subforms (see attachment). The problem is that when I click on one of the blue record navigators, I want the right subform to requery. I can't get that to function properly.
Until now I'm just using the Macro Builder and little to no VBA. There is a function Requery in the MB, but I keep getting error messages that the object doesn't exist or nothing happens at all.
I've read the page on Access mvps about linking to forms, but I'm still doing something wrong.
When I used some VB like: Me.Parent!frmStagesPerLeerling2.Form.Requery
it did work, but I an into problems with setting the visibility of the navigation buttons (they should only show when there is more then one record in that subform).
frmTaskTracker -subfrmInbox (Datasheet View - based on a query)
frmUpdateInboxItem
subfrmInbox displays a summary of tasks on a task list. The user navigates to frmUpdateInboxItem from frmTaskTracker. After updating a record from frmUpdateInboxItem, it is possible that it the record in question will no longer meet the requirements to have it listed on subfrmInbox.
I have attempted to add code to the on close event of frmUpdateInboxItem to requery the sub form on frmTaskTracker but am not getting the syntax correct.
correct my code? Alternatively is there is a more correct way to do this, I'd be happy to learn it.
Code: Option Compare Database Private Sub cmdClose_Click() Me.[frmTasktracker]![subfrmInbox].Requery DoCmd.Close acForm, "frmUpdateInboxItem" End Sub
I have a form (frmAddManifest) with a subform (subfrmManifestTransporters).
When creating a new record, I can enter data into frmAddManifest, but the subform doesn't update to link with the record - I presume it's because the record from the main form hasn't been completed yet.
Is there a way to requery the form and/or subform so it stays on the record I was working on, and link the subform properly?
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?
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.
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?
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,
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?
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.
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?
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.
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.
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.