REquery Subform 03-02-10

I have a subform (frmCamResourcesSUB1 based on a query result) on a main form
(frmCamResource).  If I want to edit data displayed on the subform.  You can
click on a name in the subform, a popup comes up that allows you to edit the
data.  When I close the popup I want to requery the subform so that the new
edited data is displayed.

I currently have this in the close event of the popup:

Forms![frmCamResource].[frmCamResourcesSUB1].Form.Requery

which only works if I open the popup a 2nd time and close, or if I close the
form and open it again.

I've also tried the following with the same results:

Forms![frmCamResource].[frmCamResourcesSUB1].Form.Refresh
Forms!frmCamResource.frmCamResourcesSUB1.Requery
Forms!frmCamResource.frmCamResourcesSUB1.Form.Requery
Forms!frmCamResource.Requery

I even tried putting the code line twice, since it seemed to want me to run
it twice, but still the same result.  Its making me CRAZY!  Whats worse is I
have the same code working perfectly for another subform.

What am I missing?
Thanx!

RHM

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1

0
RedHeadedMonster
3/2/2010 9:34:34 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
778 Views

Similar Articles

[PageSpeed] 14

Are you opening the popup in acDialog mode so that the code suspends until 
the form is closed?  Otherwise the requery might be running before the record 
is updated in the popup.  Or, are you referring to the name of the control in 
the mainform rather than the name of the form itself that is the subform?  

> Forms![frmCamResource].[frmCamResourcesSUB1].Form.Requery

Technically frmCamResourcesSUB1 is a member of the controls collection of 
frmCamResource... therefore you want to preceed it with the bang ! operator 
rather than a dot.  That might do it...

Forms!frmCamResource!frmCamResourcesSUB1.Form.Requery

I've used both the Form.Requery and SubControlName.Requery before and had 
them work... Form.Requery is probably a bit more efficient but I don't think 
it's going to make too much of a difference.


Sometimes, for whatever reason, it helps to be a bit more explicit and refer 
to the collections themselves rather than using the ES.  I've occasionally 
ran into a case where I've had to do this for correct results...

Forms("frmCamResource").Controls("frmCamResourcesSUB1").Form.Requery

note that frmCamResourcesSUB1 has to be the name of the control... not the 
form.


hth
-- 
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."  
-Thomas Edison (1847-1931) 



"RedHeadedMonster via AccessMonster.com" wrote:

> I have a subform (frmCamResourcesSUB1 based on a query result) on a main form
> (frmCamResource).  If I want to edit data displayed on the subform.  You can
> click on a name in the subform, a popup comes up that allows you to edit the
> data.  When I close the popup I want to requery the subform so that the new
> edited data is displayed.
> 
> I currently have this in the close event of the popup:
> 
> Forms![frmCamResource].[frmCamResourcesSUB1].Form.Requery
> 
> which only works if I open the popup a 2nd time and close, or if I close the
> form and open it again.
> 
> I've also tried the following with the same results:
> 
> Forms![frmCamResource].[frmCamResourcesSUB1].Form.Refresh
> Forms!frmCamResource.frmCamResourcesSUB1.Requery
> Forms!frmCamResource.frmCamResourcesSUB1.Form.Requery
> Forms!frmCamResource.Requery
> 
> I even tried putting the code line twice, since it seemed to want me to run
> it twice, but still the same result.  Its making me CRAZY!  Whats worse is I
> have the same code working perfectly for another subform.
> 
> What am I missing?
> Thanx!
> 
> RHM
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201003/1
> 
> .
> 
0
Utf
3/3/2010 12:30:01 AM
Reply:

Similar Artilces:

Money 2003 #10
Long story short, I have my checking data on my Pocket PC only and had to re-install Money 2003 on my desktop. How do I get the data from the Pocket PC to the desktop? When I try to synchronize, it wants to install Money on my Pocket PC. I have it on my Pocket PC already, complete with my checking info. I am afraid it will erase my data. ...

Subform fill in
Can someone please help me with the following, I a'm rather new at Access and try to find te most my self, but after a week still no further...... I have created a subform, this is loaded with a query. Now I have made a pulldown selection of my productid (from tabel Artikelen) this works well. The seccond field (produt name) has to be filled in automaticly when the productid is selected. The information "productname" is also located in teh tabel "artikelen" How can i do this. Thkx in advance. greez, Leukie ...

GP 10 Compatibility with Windows 7
I haven't seen any info. re: GP 10 compatibility with Windows 7. Does anyone know where I can find this? Is it compatible with a specific service pack of GP 10? I guess you haven't been keeping up with the System Requirements page: Client Requirements Operating System Microsoft Windows 7 (32-bit and 64-bit) Microsoft Windows Vista Business Edition (32-bit and 64-bit) with or without SP 1 or SP 2 Microsoft Windows Vista Ultimate Edition (32-bit and 64-bit) with or without SP 1 or SP 2 Microsoft Windows Vista Enterprise Edition (32-bit 64-bit) with or without ...

Combo Box Requery
I'm having a hard time with my replies posting so I am going to submit a new question. I apologize it's a repeat. I made the change to the row source for the combo box and will see the correct data the first time I click the dropdown. I would expect this because I haven't done the second and third part yet. Since I posted I've had to add the subform to a Control Tab and I'm having a hard time with the following: Me.subformcontrol.Form.thecombobox.Requery. I have a main form called frmVendors, a Combo Box on it called cboVendorSearch, a Tab Control ca...

Requery Question????
I have a form that changes with a parameter that is entered through a combo box. The syntax of the parameter follows: Forms!frmWhatState![cboStateCode] This parameter is entered in underlying crosstab queries that supply my main form named frmStateCriteria. In an effort to try to broaden the amount of information supplied by this form, I have added tab controls and subforms to the main form and the form now displays monthly/quarterly totals filtered by the State Code. My form displays the correct result set and totals by state as requested. The problem occurs when I change the Stat...

outlook 2003 01-13-10
Hello all My outlook appears to be trying to sen email to several address I don't know some of the email have attachments with the name happy new year ! any ideas I am concerned. Thans for youe time. Ray -- raytraci ------------------------------------------------------------------------ raytraci's Profile: http://forums.techarena.in/members/95522.htm View this thread: http://forums.techarena.in/ms-office-support/1292880.htm http://forums.techarena.in "raytraci" <raytraci.44qxnc@DoNotSpam.com> wrote in message news:raytraci.44qxnc@DoNotSpam.com...

Refresh, requery, or what?
I have a form with a subform. The data source for the subform is a table. On the main form is a command button which, when clicked, opens a pop up form. When the pop up form is filled in and closed, I want the information in the subform to be updated to include the information added in the pop up form without having to close and reopen the main form. Can someone clarify for me the VBA code to do this. I'm obviously not understanding the differences between Repaint, Requery, Refresh, ShowAll, etc. Also, I have difficulty with syntax when referring to controls in subforms. Can someon...

Report 03-28-10
Since I upgraded to rms 2.0 to sp2 I am unable to get Item Movement report Quantity sold Greater than(>)0 any help ? -- Thank You Harjit Singh SherGill This is a multi-part message in MIME format. ------=_NextPart_000_010A_01CAD273.6EAA7FA0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Gill, What is the issue/error message? Works OK here with 2.0.0126 --=20 Jeff=20 Check Point Software Search this newsgroup -- http://tinyurl.com/2lmk4w (Stolen from DRS) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3...

Filter from Main Form to SubForm
I want to be able to filter my records on my subform based on 2 combo boxes on my main form. The first combo is "cboYearSelect" and the second is "cboMonthSelect. I want to first filter them by Year and then by month. The two forms are linked by the VendorID. I'm using this code in the after update event for my cboYearSelect: Me.Filter = "[Forms]![frmSearchCriteriaSub]![Years] = '" & Me!cboYearSelect & "'" Me.FilterOn = True And then this code for the after update event for my cboMonthSelect: Me.Filter = "[Forms]![frmSearchCri...

Requerying
One of the fields of a table is sorted. SELECT tblConfigGrupos.lintIndexKMaster, tblConfigGrupos.strNomeGrupo, tblConfigGrupos.boolInactive, tblConfigGrupos.lintNGrupo FROM tblConfigGrupos ORDER BY lintNGrupo; If I change the content of one lintNGrupo field in one record, I should issue a Me.Requery to sort it again so that the new sort is displayed. To what event should I associate the command? (Is this the right way to do it?) Thanks H. Martins Try the form's AfterUpdate event. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "H. Martins&q...

Selecting a point on a chart in Excel 2007 on Windows 7 04-15-10
Hi, This may seem like a repost, but I believe that the first post was not recognized as from MSDN Subscriber. If this message lacks any significant details, I'll gladly provide them in a reply. I have a macro that operates on a point, selected on a chart. It works fine in Excel 2003 on Windows XP, Windows 7, and in Excel 2007 on Windows XP. However, I can't seem to select a point by clicking on it in Office 2007 on Windows 7. Sometimes when I select the chart *some* point gets selected, but I can't change that selection either by clicking on another point or b...

prueba 02-05-07
klfss ...

How to close a form from its subform
Form_BeforeUpdate(Cancel As Integer) If Not chkOk2Save Then Cancel = True MsgBox "Ok to save is not checked" Else MsgBox "Saving" >>>> DoCmd.Close acForm, Forms!frmEnterNotes End If I have tried several combinations of the >>>> line. Me.Parent.Close DoCmd.Close DoCmd.Close acForm, Forms("frmEnterNotes") All fail with different errors. What is the correct way to do this? Or do I have to close from the parent? -- Len ______________________________________________________ remo...

November 10, 2009 Security Update macro problems
After the Security Update for Excel 2003 and 2007 from November 10, 2009, macros became much slower and a refresh problem started happening. What happens is that when, through VBA, I place a value on a cell on an inactive sheet, the cell where the value has been placed is seen in the active sheet. This is causing some unusual behavior, as i place a lot of values in sheets that are not active. Does anyone have a problem like this? http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.officeupdate&tid=c67c9a0d-4c83-41ec-b4c6-778974190066&cat=&a...

Cell call out 02-28-10
I have this spread sheet that when you select a cell you get a hint about that cell, it is not a comment it is a call out, how do I edit that? Maybe... In xl2003 menus, look at data|validation. Barry wrote: > > I have this spread sheet that when you select a cell you get a hint about > that cell, it is not a comment it is a call out, how do I edit that? -- Dave Peterson ...

CRM 10-09-03
sir, I would like to know more about MSCRM?? Basically how it is going to develop the management people Regards Rajesh For information on Microsoft CRM go to www.microsoft.com/crm "Rajesh" <Rajesh@tvisha.com> wrote in message news:0b9901c38e47$fd9e2d50$a101280a@phx.gbl... > sir, > > I would like to know more about MSCRM?? Basically how > it is going to develop the management people > > > > Regards > Rajesh ...

Requery not!
I am unable to update the data in a subform. I have the code attached to a close button on a popup form. Code follows: Using Forms![formname]![subformname].requery DoCmd.close The form "formname" is open throughout. I requery it and it disappears. I would really like to requery the subform successfully. I am using the name of the subform, not the name of the form used as the subform. Is there something I am missing here? Thanks. Chrissy Your syntax is incorrect. Using Forms![formname]![subformname].requery Should be: Forms![formname]![subformControlname].Form.req...

Formula Help 05-10-10
I need to have a cell reference another cell if it meets within a certain time period, So in this case I will use 18:05 as the time. =if(M5=>U2,R5, if(and(M5=<U3,R5, if(M5=>Z2,R5,if(and(M5=<Z3,R5)))))) M5 = 18:03 U2 = 18:00 R5 is what I want there is M5 is withing the paramenters U3 = 20:00 Z3 = 8:00 I need to have a cell reference another cell if it meets within a certain time period, So in this case I will use 18:05 as the time. > =if(M5=>U2,R5, if(and(M5=<U3,R5, if(M5=>Z2,R5,if(and(M5=<Z3,R5)))))) > M5 = 18:03 > U2 = 18:00 > R5 is what I ...

Nested Subform causing duplicate records
I have two lookup tables (A +B) that have a parent/child relationship to each other. I want to assign each value to a third record. The B record, the child, is specifically not required. I am using two fields in my linked master fields attribute, one for each of the foreign keys I need to save. When I pick an item from the first combo box, A, a record gets saved w/ the B FK blank. Then I pick the child subcategory, B, a second record gets saved with all the data. I admit the database design is a little hokey, I'm sure there was a better way to do this than to store both a parent cate...

SQL syntax for subforms of subforms that must relate.
Hello. I am working on a meeting dbase and I have got to this point with help from this site but am stuck here. Due to the intricacy of some agendas, I have had to add levels so to speak with more agenda tables. I have 5 levels total so far. Each of the agenda level tables are set up the same as the original agenda table but with identifying level names. tblAgendaItems AgendaID (autonumber, primary key) MtgID (foreign key) AgendaItem AgendaItemName AgendaItemMinutes tblAgendaItemsLevel2 AgendaIDLevel2 (foreign key to AgendaID) MtgID (Number) AgendaItemLevel2 AgendaItemNameLe...

Office 2010 Beta 02-25-10
I have been offered the opportunity to download the Office 2010 Bets, but I am confused about one aspect. It appears that, if I choose to download it, it will upgrade my Office 2007 and I don't want to do that. I am taking a college course in Access 2007 and need to maintain that program. Is there anyway I can download the Office 2010 side by side with my 2007? Many thanks, Gordon in TX. You can only use one version of Outlook, and you would need to make sure the 2010 is installed parallel not as replace. You may find that other issues arise in attempting to flip back a...

publisher 03 vs. 02
Let me just say that I have been a die-hard Mac person for 10+ years, = but=20 recently had to set up a template for a client in Publisher 2003 on a = PC, and=20 was pretty surprised that the application was not as bad as I = anticipated it=20 would be. But now, I have a bit of dilemma. I purchased the most recent version of Publisher (2003) to do this = project,=20 and my client is running several machines with Publisher 2002. When I = set=20 the first set of files to them, all appeared ok, except for a few = instances of=20 photos not appearing on pages. We assummed it was a memory issue, o...

me.requery
Hi everyone, I'm just finishing up my first form that includes 4 or 5 tables, has multiple filters, check boxes that perform functions, and labels that become inabled and have three different enabled states. I added each function individually, and had no problems until my final testing, and now I'm at a loss of where I may be wrong. What's going on: The form has a two cascading combo boxes. When you select the customer number in the first combo box (CustNo), it gives you the possibilities for site number (SiteNo). Right now, these are both blank when you open ...

Sub requery + other question
Hi I have a form containing two subforms (sub1 & sub2) on sub 1 I have a combobox and a textbox and a unbound botton that saves the information from the combobox and the text box. On sub2 I have a form showing the informations that where input in sub1. My question is: 1. How do you requery sub2 after the sub1 button has been pressed? 2. How do I "blank out" the fields on sub1 so that the user has an "empty combobox and textbox after the poerson has pressed the button? Thank you for all your help Ticotion A bit more information first, please... Do...

Two Office 03 Security updates failed
I had a trial Office 07 that I uninstalled using the removal tool. Nevertheless, Update installed several Office 07 updates but choked on these. I also have Office 02 Developer installed. More info: Running XP on an HP laptop. These updates are old. Wouldn't I have already had them installed? I don't see them in Control Panel, Add or Remove Programs. "dw0rd" wrote: > I had a trial Office 07 that I uninstalled using the removal tool. > Nevertheless, Update installed several Office 07 updates but choked on > these. > > I also have ...