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 Replies


ADVERTISEMENT

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

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

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

Requery

Nov 2, 2006

Hi,
I have a search form and a form that display the result of the search based on the search criteria from the search form. The query works just fine and the search results are displayed well but the problem is the following: the query doesn't work with the new records inserted in those tables, only records that were in the table at the moment i had developed that search button are displayed. If someone can tell me if there exist a sort of "requery" method for that query to display the new records.

Thanks,
b0gdan

View 2 Replies View Related

Requery

Mar 28, 2005

Can't figure out where to put Me.Requery

I have a combo box [product] on my main form. On AfterUpdate of the combo I have it set to run a DLookup on a query (which is created with "tblPlan") and place that calculation in another field [costsavings]. This is working great, however, I update tblPlan each month and want it to update the calculation when I open the form instead of having to re-select the product again to trigger the query.

I have tried Me.Requery and Refresh for both the form and the combo on the main form's OnOpen and OnActivate events and it does not work.

Could someone please tell me where I need to place the code?

Thanks!

Toni

View 2 Replies View Related

How To Use Requery?

Jul 12, 2005

i have a form which contains a query and a subform. I want to click button A to refresh the query and then click button B to refresh subform.

Button A: me.requery

Button B: me.subform.requery.

However, button B doesn't work. Do they conflict?

Thanks a lot.

View 7 Replies View Related

Requery?

Jan 25, 2006

I have a form ("Clients") that points to a "Clients" table. I also have a form ("AddEditClient") that points to same table.

Open Clients form and you see client info. Have at the bottom 2 buttons. One to create a new client and one to edit the current client. B/c we do not want user to edit clients from main client form (most fields are locked on this form). So if the user clicks on "edit client" button takes them to same record on AddEditClient form... now they can edit the client (fields are not locked). If they click the "add client" button it takes them to a blank new record on the AddEditClient form. To this point all is good.

On the AddEditClient form there is only one button ("Finished" button). If they were editing an existing client I want it to return them to the same record on the client form and making sure to display the new data. If they added a new client then I want it to display that new client on the client form. If selected the new client button but then did not add a new client and simply hit finished then it opens the client form on the first record of the client table. I have it half way working right.

My problem is that if they added a new client then it does not send them back to that client. I think I need a REQUERY statement... but it seems that no matter where I put it, it breaks my opening of the correct record and then starts sending me back to the first record of the client table. My current code for the "Finish" button on the AddEditClients form is below. There is some extra stuff in there b/c I have been playing around with this for a day or two now.

Where does the requery statement go (and what is the proper syntax)? (or if this is a bad way to do this... how am I "suppose" to do it?) I had toyed around with closing one form before opening the other but then I was unable to pass back and forth my client id (key index number). As it stands now, I can not get my data refreshed (mainly a problem if a new client was added). If I put in a requery statement then I lose my position on the Client Form. So now the user would have to search for the client again. I feel like I am running in circles.

Client Form ---> points to Client Table but is essentially read only
AddEditClient Form ---> points to same Client Table but has full access
ClientK_ID ---> the key index for the Client Table... the field I am trying to use to navigate the tables from the two forms.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Clients"
If Me![ClientK_ID] > 0 Then
DoCmd.Close acForm, "AddEditClients", acSaveYes

Else
DoCmd.Close

End If


Basically I just want to be on a client... click an "edit" button to change their info. Then click a "finish" button and return to a mostly read only screen for that client. Or if I need to add a new client... click an "add" button... add a client then click "finish" and open that newly added record as mostly read only.

Unfortunatly I can't do this as a mode change... because on the Client form there are a few fields that are not read only.

Please help me. Thanks.

View 13 Replies View Related

Requery

May 29, 2006

I have a form which consists of an unbound combo box and two subforms. Now i would like that when i will select a value from the combo box, the two subforms will display the related records based on the combo's selected value.

What is the correct syntax to requery the subforms, after i select the value from the combo box?

View 3 Replies View Related

Requery

Mar 7, 2008

Hi, i need to requery a sub form from another sub from but cant for the life of me get it to work,..

Ive been testing this in a command button, but will eventually put it in an after update.

Main form is - Frm_18_Receipts

Sub form i need to Requery - Frm_39_Last_GRN
Field name in need to Requery is - Next GRN

The sub form i will execute the requery from is - Frm_19_Receipts_to_Warehouse

Expression builder from the sub form i want to execute from gives me

Code:Forms![Frm_18_Receipts]![Frm_39_Last_GRN].Form![Next GRN].Requery

Thanks AOG

View 8 Replies View Related

Refresh

Feb 13, 2006

I have two questions for someone

Is there a way to have the database auto refresh ?? If so how is that done


I use the service management template in Access. The problem we have is there a way to write a script to check for existing names when entering new ones. Like after entering all the information in a new record have it look at the first and last name and if it does exists have a alert come up stating that it already is there


THXS Steve

View 1 Replies View Related

Refresh One Sub From Another

Apr 30, 2005

Hopefully this is an easy one...... Have a form... With two subforms. Info is entered into first subform... Second subform shows a recap of info entered. Kind of a running total of an "Average" based on info input on the first subform.
OK... Problem is... The second subform updates... requeries the info on close. I want it to update the info every time a new line or record is entered into the first subform. I have tried a couple of ".requiry"s on the first subform... but no luck. I'm not that hot with VBA yet.... And can't seem to get anything else to work. Solution????
Thanks

View 1 Replies View Related

Requery Forms

Apr 19, 2006

Hi All.

I have been reading a earlier post regarding requerying forms


Forms are displayed on other form by means of a SubFormControl. It is the name of the SubFormControl that is needed. This is often the same as the SubForm but it is *not* a requirement. In your case you will be using two SubFormControl names, one nested within the other. Just for the record, you Requery forms and not fields.

How do you find out the name of the SubFormControl. I am trying to refresh sub forms and I am trying to use the following code.

Private Sub Form_AfterUpdate()
Forms!MainFormName!SubFormControl.Form!SubSubFormC ontrol.Requery
End Sub

I have 2 forms, "frmMainClient" and a subform "frmjob" and I have a command button on the "frmJob" which brings up a pop up form " frmJobNew". I fill out the fields and save via a command button.

When I look at the "frmJob" the new record I have entered is not there. It is there if I close all the forms and then open them again.

I know I need to requery the forms but I am not too sure how this is done.

Many thanks in advance.

View 1 Replies View Related

Requery: Not Working

May 29, 2006

I am trying to recreate (with many changes) a database that I have previously made, but the requery macro is not working. On my previous database, I typed the following in the row source:

SELECT [sub-activity].[Sub-Activity ID], [sub-activity].[Sub-Activity Name], [sub-activity].[Activity ID] FROM [sub-activity] WHERE ((([Combo23])=[sub-activity].[Activity ID]));

Now when I type it in my new database, the WHERE part of the statement is causing nothing to appear in my combo box. Does anyone know why that would be and what I can do to fix it? Thanks so much. :)

View 1 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 Not Working??

Sep 28, 2005

I have an "On Double Click" code in the second Combo box of a cascading combo box set. The code below works fine on a normal Combo Box, but for some reason the Requery statement doesn’t seem to have any effect in this instance. The data that has been entered into "FRM_DelPoint" does not appear (in the second Combo box [Combo18]) unless the First combo box in the set is changed :mad:

What have I got wrong?


Private Sub Combo18_DblClick(Cancel As Integer)
On Error GoTo Err_combo18_DblClick
Dim lngcombo18 As Long

If IsNull(Me![Combo18]) Then
Me![Combo18].Text = ""
Else
lngcombo18 = Me![Combo18]
Me![Combo18] = Null
End If
DoCmd.OpenForm "FRM_DelPoint", , , , , , acDialog
DoCmd.GoToRecord , "FRM_DelPoint", acNewRec
Me![Combo18].Requery
If lngcombo18 <> 0 Then Me![Combo18] = lngcombo18

Exit_combo18_DblClick:
Exit Sub

Err_combo18_DblClick:
MsgBox Err.Description
Resume Exit_combo18_DblClick
End Sub

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

ReQuery A Different Form

Jul 19, 2005

Can someone please check this code for me, I just need to make sure that what I am doing is correct!

I am trying to requery a form from another form:

[Forms]![Form1].[Text1].Requery

View 4 Replies View Related

Me.Requery - Not Sure Where To Put This Code

Jan 29, 2006

A user yesterday informed me I need a me.requery. I have a form with tabbed pages. First page I complete details of clients - second page goes into more detail. On second page I have a combo box listing all clients in alpha order. I want to get the new client I have just completd on first page into that combo box without having to close and re-open form. Does this code go against combo box, or page? Is there anything I need to add to this code, like form name? Have tried in various ways without success.

View 4 Replies View Related

Still Got Requery Problem

Jan 30, 2006

I've been trying to apply a requery, but still can't get desired result. My db structure: I have an input form with 4 tabbed pages. First page of form is for entering basic details of a client. Second page goes into more detail. At top of second page, I have converted text box into a combo box and through query builder all client names appear within combo box in alpha order, so user does not have to retype client names. Trouble is the client name does not appear in combo box unless I close and re-open the form. Rickster57 kindly gave me code for a requery of:

Forms![first form]![second form].Form![combo box name].Requery

Have put in the After Update property of the client name text box on page 1

I question now if it's a form I'm working with or pages? (You'll understand I'm relatively new to VBA!!!)

Any help appreciated

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

Problem With Requery

Mar 28, 2006

I'm performing a DSum on a subquery that adds up percentages for different customer types. Whenever the percentage is changed the DSum needs to reflect that so the person doing the data entry knows that all the percentages add up to 100.0%. I set up a requery macro for this function. This worked fine until I started doing sample entries. It wouldn't let me put in a decimal point. So I went into Visual Basic but I think my code is bad:

Private Sub Mix_Percentage_Change()

Queries!QRY_Customer_Mix_Form_UserSubForm![Customer_Mix].Requery

End Sub

Help??

View 1 Replies View Related

Requery Form

Apr 3, 2006

I am new at Access and have a database that has 2 tables (Donors and Donations). My donations form's source is a query. I have a combo for the DonatorID on the Donations form. I have a On Not in List macro that opens the Donors form so they can enter the name of a new donor. This works great but when you close the Donor form and the focus goes back to the DonorID combo, the new donor isn't in the list. How can I requery this so the new donor that was added to the Donor table shows up in the combo? I played around and added another combo that had tab index 0 and then everything works but this aint the solution.

Thanks for your help.

Art

View 1 Replies View Related







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