Unable To Refresh / Requery Subform Using VBA?

Sep 12, 2012

There are 2 levels of forms, the main parent form is called INSPECTION. Then there are two subforms: TESTRESULTS and addTESTRESULTS.

the form TESTRESULTS is linked to the TESTRESULTS query "QTESTRESULTS2". This query looks at two hidden fields on INSPECTION called FILE and REPORT NO. The query finds all fields inside of TESTRESULTS that match the two criteria. This works fine. The form TESTRESULTS is linked to the QTESTRESULTS2 query as direct data source link. This works fine.

a temporary table has been setup to append test results to TESTRESULT table. This works fine. What doesn't work fine is updating the subform TESTRESULTS when needed. I want it so that the welder enters his information, clicks save, the info gets appended to TESTRESULTS table and instantly updates on the form for them to verify.

[inside subroutine for saving a record] all efforts at accessing this form have failed. I've tried !form!subform!requery, it has failed, I've tried making dummy fields inside the form and accessing them and that has failed, I've tried .setfocus on the form and that has failed, each time the compiler tells me 'unknown field', when in fact I'm trying to hit the form itself.

Its worth mentioning that I've set events [on this form for any kind of update event including mouse click] to Me.requery for this form when you click on it, it updates, but I need to automate this somehow, and the form just seems untouchable via VBA.

View Replies


ADVERTISEMENT

Refresh / Requery Subform Upon Combobox Change

Jun 17, 2013

I have been using AYS2000 database example from Rogers access library. I have been in the process of modifying to meet my needs. Although I have run into a problem that was prevalent in the original database example. I have attached the original database for your reference.

Problem: At the bottom of the database beside the "New Response" button there are 2 combo boxes that allow you to select the survey and response in which you want to view in the subform. Although when selecting the response the subform does not always update the record in the subform. It would appear that the problem occurs only after a response has been previously selected. I have tried adding additional code to refresh and requery the subform already without any success.

View 3 Replies View Related

Forms :: Requery Control On Subform From Main Form - Refresh List?

Sep 8, 2014

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..

View 2 Replies View Related

Another Refresh / Requery

Jun 12, 2005

Hi all

I am sorry if this has been asked already a million times already but I could not find any relavant information in the time I had.

I have a requery / refresh problem.

I have a Customers form showing all customers, I also have a NewCustomer form for adding new customers.

On the Customer form, on activate I have me.refresh

On the NewCustomer form I have in the onclose,

If IsLoaded("Customers") Then
Forms!Customers.Requery

These work well however if Customers is open and I enter a new record in the New Customer Form, then view the Customer form again the new record is not shown.

I can however click back on the NewCustomer from then straight back to Customers and Hey Presto it appears

Any clues as to what I need to do to update the form?

Thank you in advance for your help

View 2 Replies View Related

Refresh Or Requery Problem

Mar 3, 2005

Hello,

I am looking for a way to ensure a sub form is refreshed or requeried.

I have forms as follows:

1.form for Purchases
2.subform for all items purchased
3.subform which has the total purchase price ie the total of all items in the subform 2 above

A save is forced in 1 before data in 2 is entered. Once 2 is exited a save if forced. However 3 is not calculated unless a manual refresh is performed.

I am sure there must be a way around this. Any suggestions would be helpful.

Thank you.

View 3 Replies View Related

Forms :: How To Refresh / Requery MSysObjects In Combobox

Jun 18, 2015

I set up several combo boxes to display Tables from msysobjects. The record source is using a WHERE clause to display certain tables both Linked and Local. Occasionally, when clicking the dropdown arrow, the box only displays local tables. This situation seems not to matter whether tables have been newly linked or unlinked. despite having both a me.requery and a me.refresh in the code and/or even clicking the Refresh All button on the ribbon menu, the form does not seem to update the combo box to display both linked and local tables.

In further testing, it seems that it is not a form issue because I took the SQL statement I used as the record source and created a new query with the sql string. The query behaved the same as the combo box, only listing out local tables.

My current work around is to close the database and reopen, then all is well. Hopefully there is another way to get the linked tables listed without this drastic step.

Don't think it's necessary, but here is the sql statement. Type 6 is linked.

Code:
SELECT msysobjects.name
FROM msysobjects
WHERE msysobjects.[flags] = 0
AND msysobjects.[type] in (1, 6)
AND Right([name],7)<>'_SOURCE'
AND Right([name],4)<>'_OUT'
AND msysobjects.name not in ('tblImport','tblImportFormats','tblUniversal') OR msysobjects.database=gblprojectname()
ORDER BY msysobjects.name, Right([name],7);

View 9 Replies View Related

Modules & VBA :: Refresh / Requery Form From CmdButton

Jan 23, 2014

I have a main form that the user will enter data. Once they hit a submit button, it saves the record and I was hoping it would also refresh the form in which is populated by a query. The form that is linked to a query will be displayed on a monitor 24/7. It will display pending orders. So I was hoping as new orders are placed, the query would display them without needing to be closed and then reopened.

Here is the method I'm using but it's not working.

Code:
DoCmd.Requery "frmPDMonitor"

View 1 Replies View Related

Forms :: Refresh Pivot Chart In Subform After Changing The SQL Of The Subform's Query?

Sep 16, 2014

I have a form, a couple of comboboxes and text boxes on it. When these are filled out, the SQL of a query is changed using these parameters.

There are three subforms on the form, all pivot charts, all based on the query being changed.

The goal would be to update all three according to the user-given parameters.

Right now the subforms only update if I close and open the form, which is probably not the best solution, since it's too slow.

I've also tried to requery and refresh them, with no result.

Then I tried to overwrite the recordsource of the subforms with the same text that was originally there. This got them to refresh their data, but then all of the charts disappeared and had to be built again, so this is a no go too.

View 7 Replies View Related

Forms :: Requery 2nd Subform When Different Record Highlighted On First Subform

Sep 3, 2013

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?

View 10 Replies View Related

Forms :: Get Subform To Requery After Choosing A Name From Combo Box On Subform Itself

Jul 26, 2013

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.

View 14 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

Modules & VBA :: Update Subform Requery Other Subform

Oct 5, 2013

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

Code:
[Forms]![FRMDATESUM]![frmHOURSUMnowork].Requery
[Forms]![FRMDATESUM]![frmHOURSUM].Requery

when the user updates the combobox in subform one nothing happens to the other subforms until close and reopen main form

View 2 Replies View Related

Forms :: Requery Subform From Another Subform

May 8, 2014

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).

View 3 Replies View Related

Requery A SubForm

Jun 21, 2007

Hi,

I want to requery a SubForm using the on Click event of a combobox that is located on the main form. I used this code below, but it does not work.

Forms![frmSite]![subRoadsConstructionConsent].Requery

Any suggestions please,
B

View 6 Replies View Related

Requery SubForm

Jan 26, 2005

I'm trying to requry a sub form based either or both text boxes. I need help with the code. I'm trying to rewrite something from a sample but can't seem to get it to use the criteria. It does requery though.

Private Sub cmdSearch_Click()
Dim sCriteria As String
sCriteria = "WHERE 1=1 "



If Me![Search] <> "" Then
sCriteria = sCriteria & " AND MedicalRecordsUpdating.SerialNumber """ & Search & """"
End If

If Me![SearchEvent] <> "" Then
sCriteria = sCriteria & " AND MedicalRecordsUpdating.Event """ & SearchEvent & """"
End If



Forms![RecordManagment]![FrmMedicalRecordsUpdating].Form.Requery

End Sub
Can some one steer me in the right direction

View 5 Replies View Related

Subform Requery

Mar 21, 2006

I have a form that contains a subform, upon clicking the notes button a new form is presented. Upon saving data I want the form to requery the publishers sub form here is my attached code:

Private Sub buttonsave_Click()
DoCmd.Save
Forms!Publisher![Notes subform].SetFocus
Forms!Publisher![Notes subform].Requery
DoCmd.Close
End Sub

The for does not requery I have to move to the next record and come back to see the new updated notes. TIA

View 5 Replies View Related

How To Requery A Subform

Feb 17, 2004

I'm having trouble updating a combo box automatically. I have a main form [Orders] containing a combo box with a list of Buyers. Inside this main form is also a subform, [Order Details], containing products to be ordered which is also selected by a combo box. However, each buyer has a different set of products. I tried filtering for only the products by a certain buyer but when I go to a new record, the product list remains the same according to the buyer on the first record when the form was opened. What do I need to do inorder to have only the products for the chosen buyer appear in the combo box when a buyer is selected in the main form?

View 5 Replies View Related

Refresh Of Subform

Apr 13, 2006

I have a form with one subform that lists trucking loads. The form is set to run modal. There is one button on the form to add new loads which when clicked opens a popup form to enter new load. When you click on the Save button on the popup form it saves load to table and closes taking you back to the Form/subform with list of trucking loads. I have tried various refresh tips to get the new load to show, but I have to close the Form/subform and re-open for the new load to show up. Is there a way I can get the Form/subform to refresh after I click the save button on add load popup form so it shows this new load without the need to close/re-open the Form/subform?

View 1 Replies View Related

Subform Refresh Help

Apr 14, 2006

In my database, I have a form that has 2 subforms on it. Both subforms are set to run off a query that is driven by a text field on the main form. I want to have a button on the form that when pressed, it will refresh the subforms based on the value in the textbox. I can't find a good way to go about this, any ideas?

View 1 Replies View Related

Refresh A Subform

Apr 7, 2005

Refreshing a sub form.

I have a form in which a 'read-only' sub form is placed. The sub form is based on a query. I have a button on the main form which opens another form with check boxes which allows updates the to table.

I want the readonly subform to refresh/requery after the close event of the update form.

What is the event I need to use? I've tried activate, gotfcous on the main form. I am tearing my hair out.

View 5 Replies View Related

Refresh Subform

Oct 6, 2005

Hi All,

I have one main form in which i have 2 subforms on different tabs.All the forms are unbound. Basically i am trying to assign a order to multiple persons.SO the main form has the order information.1st subform shows the already assigned persons and the second one is for assigning new persons.

The problem i am having is that whenever i assign a new person using the second subform i want to refresh the first subform but i am failing in it.

i used forms!firstsubform!refresh on the second subform..but it says object doesnt support the property or method.Then i create a refresh button on the first subform and on its click event i m doing me.refresh but again its failing.

The first subform is not bound and it has datasource as a querry like select a,b,c from order where orderid=txtorderid.

Any help on this pl.thanks

View 7 Replies View Related

Refresh Subform

Jun 14, 2006

hi guys, here is the situation.

I have 3 forms:
1- editpopsubform where the info comes from a select statement. There is one field in the list which is the status and it changes the backround colour depending on the status value.

2- editPoplist , which has the form 1 as a subform

3- editpop, a form which allows the user to edit a record selected in the poplist form.

If i modify the status in the form number 3 (editpop), when i go back to form 2 (editpoplist) , the status's value changed but the colour doesnt.
any idea?
thx, max.

View 1 Replies View Related

Subform Refresh Only

Oct 9, 2006

I have tried in vain using refresh programming to overcome this,

I have a main form that records site and date information. Within this there is a subform that records a number of fields that are standard, but differ according to site location, so that it appears like;

Offsite1 Onsite1 Offsite2 Onsite2
a a a a
b b b b
c c c c

So what I want is for the main form to record that site and date info, with a subform recording the above listed info. One new record within the corresponding table will be created for each grouping (i.e. Offsite1).

To do this effectively, I want to go to the next record once I have filled in the information for Offsite1 for example, this will record the site, date and Offsite1 information in the table. When moving to the next record however, I want the site and date information in the main table to remain or be copied across. The subform will clear as it is a new record and so will the main form normally.

Can anyone help?

View 6 Replies View Related

SubForm Combo Box Requery

Jun 24, 2005

I am a newbie to access and am having some difficulty with a subform. I have searched the forum, but could not find an exact match to my problem.

The following is a simplified version of my problem:

Tables: TSerialNumber, TLocation, TSubLocation(Location and SubLocation Fields)

Form: ServiceForm
SubForm: ServiceSubForm
Form and SubForm linked by SerialNumber

In the SubForm: I have 2 ComboBoxes: Location, SubLocation
Location - Row Source is the Table TLocation
SubLocation - Row Source is a Query of SubLocation relating to the Location

I need the SubLocation field to be requeried OnChange from the Location ComboBox.

If I use the subform as a form I can get this to work by using a macro to requery the SubLocation, but when I try to use it as a subform I get an ApplyFilter Error.

Thanks in advance for any help.

View 3 Replies View Related

Subform Requery Problem

Jul 25, 2005

Hi there,

I hope someone can help... and i hope i can explain this properly.
Some background... I have a form which has a Global ID as one of the fields.
From this form another audit results form can be opened (on the click of a button) that shows the results of Audits based on this ID. The results of audits are in a flat un-normalised table(this is not an issue at this point)

On the top of the audit results is a textbox for the 'GID', the contents of which have been copied from the original form where the button was located. This process uses a macro.

OpenForm
Set Value
[Forms]![frm_Audit Result]![Audit Result GID]
=[Forms]![frm_Call Log]![txt_Global ID]

The audit results form has a subform which displays the result of a query based on the the value that is copied.

The txtbox displays the value fine, but the subform does not display the result of the query.

The query has number of fields but the criteria for filtering the correct ID's is:
[Forms]![frm_Audit Result]![Audit Result GID]

Its just that the subfrom does not display any result as soon as the audit results form is launched. If I alter the number in the text box and hit enter, the subform displays the correct results.

The subforms Record source is the query.

I've tried numerous ways around the problem with various attempt to update the query on various events, but have had no luck.

I guess i need to rerun the query and then refresh the subform once the main form has the GID copied over... but am not sure how to rerun the query and at what point/with which event?

Any pointers are much appreciated.

View 6 Replies View Related

Requery Subform - Not Same Record

Sep 23, 2005

Hi. First off I want to say that these forums are a gold mine. You all do a great job. Keep it up!

I work at a University and keep a database of students. On the main form for the student, you select their name from a combo box and the whole form refreshes to show the data for your selection. There are four subforms that keep track of things like a questionnaire, career center visits, etc. The problem I am having is with the Career Center visits.

There is a button that allows you to make an entry into a log when they come into the career center. Clicking on it opens up a small window where you can put notes and with whom they spoke while they were here. Upon closing the window, it adds the entry to the log for that particular student. That all works great. Each student has their own log...all is good.

However, upon closing the window, the main form jumps back to the first student in the list. The entry is added to the correct student, but you must find the student from the combo box in order to see it. It is just annoying to have to do it and I would like to fix it. Can't figure out why it is doing it, though.

Any ideas? I would like it to add the entry to the student, and stay on their record.

View 5 Replies View Related







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