473,396 Members | 2,076 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,396 software developers and data experts.

requery a subform on a form

ken
Hi,
I have a main form with a text box and a filter button. I also have a
subform in the main form. When I make an entry into the filter text box
and click the filter button, I change the query definition of the
subform and then try to requery the subform, but no matter what I do it
does not requery?

While my main form is open and after I clicked on filter, I can open
the subform query and see that the sql changed correctly. I can open
the subform itself and its filtered correctly, but the subform on my
main form won't change unless I close and reopen the main form?

Does this mean that is I changed the SQL behind a query in a form I
can't see it untill I reopen the form?

Nov 13 '05 #1
3 12786
ken
Found an answer to question(This worked for me):

Steven Hemingray Jun 14 2001, 7:31 am show options
Newsgroups: microsoft.public.access
From: hall...@hotmail.com (Steven Hemingray) - Find messages by this
author
Date: 14 Jun 2001 05:31:51 -0700
Local: Thurs, Jun 14 2001 7:31 am
Subject: Re: Refreshing a subform
Reply to Author | Forward | Print | Individual Message | Show original
| Report Abuse
And where should I put that? Under the current buttons code? "Bruce M. Thompson" <NO~SPAM_bthmp...@bigfoot.com> wrote in message
news:0V***************@newshog.newsread.com...
Mike: A simple "Me.NameOfSubformControl.Requery" should take care of that. This

will,
in effect, reopen the subform instance.


Try putting it in the afterupdate field of the main form, or if there
is a command button used to change the data, put it at the bottom of
that.
I had a problem with this as well where just doing a requery didn't
work for me. If that's the case for you as well, put this in the
afterupdate field or the command button code:
me.subformname.form.recordsource = queryname

Also, subformname here is the name of the subform control, which isn't
always the same as the name of the form itself.

-Steven

Nov 13 '05 #2
On 7 Sep 2005 19:37:52 -0700, "ken" <ge****@gmail.com> wrote:
Hi,
I have a main form with a text box and a filter button. I also have a
subform in the main form. When I make an entry into the filter text box
and click the filter button, I change the query definition of the
subform and then try to requery the subform, but no matter what I do it
does not requery?

While my main form is open and after I clicked on filter, I can open
the subform query and see that the sql changed correctly. I can open
the subform itself and its filtered correctly, but the subform on my
main form won't change unless I close and reopen the main form?

Does this mean that is I changed the SQL behind a query in a form I
can't see it untill I reopen the form?

Requery the subform in code.
After you have changed the SQL of the subform's query, add a line like
-
Me.frmMySubForm.Form.Requery
Nov 13 '05 #3
ken
that does not work unless I have me.subformname.form.recordsource =
queryname before Me.frmMySubForm.Form.Requery

I don't know why, but if you do..please explain. Thanks

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michelle | last post by:
Hi all I have a main form which has a combo box and a subform. The two forms are linked by ShiftPatternName which is basically the value in the combo. the combo has the following code ...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
2
by: F. Michael Miller | last post by:
I need to requery a subform from a third form and can't seem to get it to work. frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my...
1
by: Johnny Meredith | last post by:
I have an unbound main form (one side) with a subform (many side). The main form has a textbox control on it whose visible property is set to false. It's controlsource property is a reference to...
1
by: BartonConstruction | last post by:
Greetings all, I have a main form (frmClients) with two subforms (subVisits) (subAccount). I got the subforms to reflect what the main form is showing by linking master and child fields (I...
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....
1
by: Parasyke | last post by:
I have a subform within a tabpage that will requery/refresh (?) if I press F9 and it will update the data in the subform, but I have tried various combinations of Me!SubformName.requery...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.