473,320 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Trying to requery a subform in access 2000 on an event

Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark
Jun 8 '07 #1
2 2745
ADezii
8,834 Expert 8TB
Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark
You must Requery the Sub-Form ontrol itself NOT the Source Object which is the Form Name used in the Sub-Form Control.
Jun 8 '07 #2
FishVal
2,653 Expert 2GB
Hi all,

I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and hit F9 I get the desired result. Which is the list on my subform is refreshed to show the new result of the query that populates the subform.

I have tried the following:

[code]
Private Sub Status_AfterUpdate()
Me![frmOpenWorkOrders].Requery
Me.frmOpenWorkOrders.Requery
Forms![frmWorkOrderMain]![frmOpenWorkOrders].Requery

End Sub
[code]

Not all at the same time of course. I have also tried each of the above in the on change event of status. I can do a requery on the main form so i know the syntax is close but the syntax to requery the subform is eluding me.

Any help would be very much appreciated.

Platform
Win XP
Access 2000/VBA

Thanks,
Mark

You can require subform in the following way.

Me![frmOpenWorkOrders].Form.Requery

Assumed that the subform control has the name "frmOpenWorkOrders".
Jun 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various...
2
by: Gilz | last post by:
Hi Hope someone can help this is driving me round the bend. I have a form called "frmMain_People" with a tab control on it with 2 sub forms called "fsubMain_People_Enquiries_Live" and...
14
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button....
2
by: jpatchak | last post by:
I am experiencing two distinct problems with the Requery method in Access 2003. Problem 1: I have a series of text boxes on my form. The control sources of these text boxes are used in...
3
by: Danny J. Lesandrini | last post by:
-- previously posted on newsgroup :: <microsoft.public.access-- Has anyone else noticed this behavior? Focus jumping from current cell to upper left in embedded datasheet. If not, would you be...
5
by: ApexData | last post by:
I have a ComboBox, when dblClicked, displays the combobox's row content in a continuous subform. Changes can be made to this content in the subform and then closed. The ComboBox needs to be...
4
by: Robert | last post by:
Hello. I have a form with 2 subforms on it, subform1 and subform2. Is there some way to requery subform2 from an after update event on one of the fields on subform1? What would the syntax of...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
10
beacon
by: beacon | last post by:
Hi everybody, This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure. Anyway, I have a form with a (continuous) subform, and on the subform I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.