How to requery main form before opening subform.

I have a main form and a subform. The subform displays fields also visible in the main form such as 'Name'. When I click a button on the main form it opens this subform. The problem is this:

Everything works fine with existing records, but when I click a button on the main form, to open up the subform, the Name field in the subform is blank, unlike that of the main form, which has just been filled in. Both forms are linked to the same 'name' field in an underlying table.

So I suspect, filling in the 'name' field in the main form, only updates the underlying table upon closing the main form (or changing the record?). What I want it to do is to update the main table as soon as the name text box has been filled in, in the main form. I hope this is clear

Sponsored Links:

Related Topics

Update text box on main form afterupdate of subform
I have a text box located on the main form. I would like to requery the total given in the text box (based on a query) on the AfterUpdate event of a subform. I have a second subform that uses the same query and can get it to update fine, but the text box will requery the entire form.

This would not be a problem, but the user can enter time for previous days, and therefore the requery moves the previous days records to the chronological order.

The short, is on an AfterUpdate event on the subform, how can I requery just the text box on the main form?


Requery Subform
How to requery the subform based on date range after update in Main form. Example: The forecast quantity in main form was revised based on the new startdate and enddate. How do I requery thesubform in order to revise the forecast quantity?


requery a combo in subform from main form
I have a main form frmInspections that has a subform frmEquipment

I am trying to requery a combo in subform (cmbEquipDetails) based on a selection in the main forms combo box

I thought this code should work however it is not
in afterupdate of first combo

Forms!frmInspections!frmEquipment.Form![cmbEquipDetails].Requery = True


requery subform
I have a date field on a subform that is defaulted to the date field on the main form. When I change the main form's date, I want the subform's date to change as well.

To do this I am using the "requery" command in the "on change" event property of the main form's date field. When I open the forms, the defaults all work, but when I change the date on the main form, the subform requeries to show the data that is in it's table, Is there a better option than requery?


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
Forms![Navigation]![Search].Requery
Forms![Navigation].[Search].Requery
Me![Loan Search subform].Form.Requery

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


Subform requery Access 2007
I have a form in ms access 2007, with multiple tabs. Some of these tabs have subforms.
I want to update one subform from another but am having no joy. I cannot requery the second subform. ive read alot of threads about requery, referencing the main form and then subform2, the subform control name v's form name etc but still no joy.

Subform1 sets up the data displayed in subform2 - so depending on subfrom1 some fields in subform2 could be hidden or placed in a particular position on the form. I have this visible/not visible code in the onload event of subform2. This works well if the main form is closed after subform1 is updated. When I reopen the main form subform2 is displayed correctly.

I know the subforms are already "loaded" when the main form is opened but how can I get subform2 to reload when subform1 is updated. Should I have my formatting code of subform2 in a differnt event than onload? Is requery the correct command to use? when i want to esentially reload subform2.


.requery Method and the OnQuery Event
I have an Access 2007 database. I have a form frmMain with a subform frmSub. In the main form I have a Save button. When the Save button is clicked, the main and related records are checked to see if the necessary detail has been entered.

When checked, if the related record is not complete, the user has the option to either edit or delete the incomplete related record.

If the record is deleted, then the subform is requeried to show the updated records (rather than the #Deleted entry).

All of that works as it should. BUT! There is a label in the header of the subform that displays a count of the records in the subform. It is updated OnLoad , OnQuery, OnCurrent and OnDataSetChange.

However, when I requery the subform using Forms!frmMain.frmSub.Form.Requery the label is not updated.

Should any of the above events be triggered by the .Requery Method?


Requery subform in tab
I have a main form called Activity Log which has four tabs on it. Each tab has a different subform. When one form has a date entered it alters information (actions) on another tab via code. When the user then clicks on the Action tab I want the latest to display. I assumed I needed to requery this subform which is Named ActionLog (name not source object) and tried by entering the following code on the onclick event of the Actions tab:

Forms![Activity Log]![ActionLog].Form.Requery

but it doesn't show the latest data. If I close the main form and reopen the Actions are correct so I know the data is changing correctly


unbound subform requery/new
Have an unbound subform ; it is a continuous form; it is set for Data Entry in its form property.

when the main form first opens is well - the subform is blank; after the user populates some info into the subform - then I need to press a button on the main form and "refresh" the subform to a blank slate.

gotonew record just moves the record selector to the bottom new record - leaving the existing data showing.

other than closing the main form manually - and reopening - - I don't see a way to reset this subform.


Only allow a button to HIDE a subform, and not show the subform.
I have a main form that opens up a sub form based on criteria entered into the main form. After the info is entered into the sub form, I use a button on the main form (tied to the code below) to hide the sub form.

I need to prevent the user from opening up the sub form manually by pressing this button on the main form. I only want the sub form to pop up automatically when the criteria is met in the fields of my main form.

What do I need to do to this button so that it can only be used for closing the sub form, and cannot be used for opening it manually?


Refresh Requery Subform
I'm trying to Refresh/Requery data on a subform from a completely separate pop up form. This code is set up in an AfterUpdate:

Forms!frmAllProj!sfrmSegmentsSub.Form.Requery Forms!frmAllProj.Refresh

I'm not sure why it doesn't update right away, but it will run the requery, and the only way I can get it to refresh the subform data is if I close the pop up form that this is running from, and then refresh the main form. (which is why I tried sticking the Forms!frmAllProj.Refresh in there)


How do i requery listbox in subform
How do I requery a listbox that is contained inside a subform?

Listfacility is a listbox in main form while the listlender is a listbox in subform.

This is my current code:
[Forms]![ListFacility].[Form]![ListLender].Requery


Requery Row Source in a Combo Box inside a Form
I have a MAIN form. Then I have a Subform. When the Address ID of the main form changes, the subform shows data for the Address ID selected (via requery in VBA).

The subform now has a combo box which is based on the Row Source: SELECT [QueryName].[FieldName] FROM QueryName ORDER BY [Queryname].[FieldName];

When the Address ID in the main form changes, the subform data also changes but the RowSource data doesn't update.

How can I make sure that the Rowsource data also updates at the same time?


Refresh Requery Subform
I'm trying to Refresh/Requery data on a subform from a completely separate pop up form.

Forms!frmAllProj!sfrmSegmentsSub.Form.Requery
Forms!frmAllProj.Refresh

I'm not sure why it doesn't update right away, but it will run the requery, and the only way I can get it to refresh the subform data is if I close the pop up form that this is running from, and then refresh the main form. (which is why I tried sticking the Forms!frmAllProj.Refresh in there)


Requery the subform in a form
I have a form called "Main Form" and a subform within it. The main form lets people choose a product from a combo box and then hit a control button called "Add Product" which places their selection in the underlying "Selected_Tbl". It then moves to a new record, making all fields look empty again, where the user can choose another product. Up to here, everything is working fine.

In the sub form I want to keep a running list of the "shopping cart". Its in datasheet view and its record source is "Selected_Tbl". However, it does not update to reflect the products. I went to add a "Requery" statement to the On Click event of the Add Product button. BUT how do I reference the subform to have it requery? I looked through all the properties and could not find the sub form's name. all I see is the caption (which, when referenced obviously did not work).


Requery of Datasheet Subform Causes Verticle Scroll Bar to Disappear
I'm using Access 2010 sp1.
I have a form with a data sheet subform. In the AfterUpdate, (Me!frmContactsSub.Form.Requery), when I requery the subform the Vertical scroll bar disappears.


Requery in the form
I have a main form. in the main form I have linked it to query. in the main I also have 3 unbounded combo boxes to filter for Provinces, Districts and Villages.

My question is that: is it possible to run requery within the main form button please


Subform showing white
There are lots of ideas on the internet to fix this one but none seem to nail the answer. Access 2003. A subform shows as white when viewing the main form.

My query shows data, opening the subform by itself shows data, but when opening the main form - no data in the subform. I have rebuilt the query, rebuilt the sub form and then relinked the two - same result


RepaintObject Error: [sub]form not open
I have a subform inside of a main form. The main form is bound to my table and the subform is bound to a query for child items for the main table.

On the main form, I have a combo box bound to my child items field that displays a list of choices in order to tie the item to any other item in the table. In the OnChange of the combo box, I have a macro that is supposed to requery and repaint the subform in order to display the updated data.

The Requery macro runs without error, however the RepaintObject macro gives me an error saying that the form is not open.


MS Access - Subform
I want to consult with users in this forum the following:

my database contains a form which includes a subform.
What command through VBA or macro I can set the action of opening the form:
1) mode of data - the addition (to form & to subform that is displayed as a data sheet)
2) mode of data - modifications (in the form of records and also a datasheet subform, which belongs to the entry of the main form).

Basically, this is the mode setting data for each subform when the main form is opened.