473,729 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform refresh to changed query

How do I make a subform change to reflect a changed query which is the
forms Source Object.

Another part of the application has changed the query via VB, and I can
see that the query is how I want it, but the subform hasn't picked up on
the changes.

Refresh doen't work
RefreshDatabase Window doesn't work

Anything along these lines?

Thanks for your help

Nov 13 '05 #1
4 5643
Once you detect the query change, trigger a sub with the following
code:
Me.RecordSource = "Query_Name "

This will refresh the form.

Nov 13 '05 #2
access-guru? wrote:
Once you detect the query change, trigger a sub with the following
code:
Me.RecordSource = "Query_Name "

This will refresh the form.

Thanks for your reply,

The subform doesn't have focus -- would that matter?

Would I need something along the lines of

Forms!MainForm! Subform.RecordS ource = "QueryName"

Thanks again
Nov 13 '05 #3
access-guru? wrote:
Once you detect the query change, trigger a sub with the following
code:
Me.RecordSource = "Query_Name "

This will refresh the form

Thanks, but I get an error message
runtime error '438
object doesn't support this property or method
I have a master form called 'Hall Bookings from Calendar'
inside this I have a subform called 'Sidebar'

Perhaps a picture is better...

_______________ _______________ _______________ _______________ _______________ ____
Form_Hall Bookings from Calendar
_______________ _______________ _______________ _______________ _______________ ____
_______________ _______
Subform_Sidebar | Date:
| Name:
P Dec 31 New years | No Guests:
R Jan 5 Wedding | Many other fields:
R Jan 7 Meeting |
_______________ _______|
_______________ _______
Listbox |
|
Riverside |
Palace |
|
_______________ ________
_______________ _______________ _______________ _______________ _______________ ______
So when they click on Riverside in the listbox, the Query that is the
recordsource for sidebar is changed to restrict the listing to only R
events.

Clicking on an individual event in the sidebar causes the fields on the
form to reflect that event.

Everything is working, except the update to the sidebar. If I close the
form and reopen it, it reflects the changed query.
Thanks for any help you can give

Lester.
Nov 13 '05 #4
I found a partial solution/workaround

I placed the me.recordsource ="xxx" that you suggested in the doubleclick
event of all fields on the form

Now everything is usable, but it's not the most elegant fix.

If I put it in the click event, the window always scrolls up to the top
and focus moves to the first record everytime someone clicks inside this
subform. Same problem with filtering techniques.

Nov 13 '05 #5

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

Similar topics

2
4396
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a separate unbound form with all the fields, which are on the subform. The fields are filled in with data programmatically. User edits. Edited fields are copied into fields on the subform programmatically as well. I need to catch change in one of...
6
5476
by: Tim Marshall | last post by:
Here's the situation. A form, frmSetUp, with a subform control called subExplain with a source object form frmSetUpSubDefineSides. The source object is a bound form, displaying a few records, no edit, adds, filters, etc, are permitted on the subform. An add or edit button on the subform is clicked opening an unbound form, frmSetUpSideAdd, (populated with values from the above subform if this is an edit of an existing record) for data...
3
12826
by: ken | last post by:
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...
1
4885
by: MLH | last post by:
I have frmVehicleEntryForm and on it is frmAddnlOwnrListSubForm. The subform is unbound and lists records in a table, allowing the user to change values in CheckMark controls on the subform as desired. I have another button that will allow user to run a query which will update the field values related to the checkmark control to False. To be sure the changed values show up in the subform control, I'm thinking of running a line like the...
1
1351
by: Lori2836 via AccessMonster.com | last post by:
Can someone help. I'm afraid I'm not too good at Access. What I'm trying to do is create a main form with a subform. The subform is "Search by Item Desc", which the record source is a query called "Item Desc". I want to have 2 fields in the Detail section of the main form.......Item Desc and Part Number, where you can enter an item desc or part number, such as "Specials" and have the subform below show just the parts and information...
1
5424
by: Stinky Pete | last post by:
Hi everyone, I have been updating a file that uses a main form that contains a subform (as a datasheet). The main form really does not do anything on opening except maximizes to the users screen size. The subform however runs an "embedded" query (cause I don't know the right term) to show a list of records based on the embedded query. BTW, by embedded, I'm indicating the form does not run an external query but uses the query included...
3
447
by: DeanL | last post by:
Hi Guys, I've been handed a database (Access 97) that is a couple of years old that no one has maintained and is now experiencing a problem. The database is used to run several reports based on the data contained in the db and all data is stored with a unique project id. The original designer set the db up to have a single subform that lists all current project id's and uses this subform inside several other forms that are used to run...
7
2303
by: mmckinnon | last post by:
Hi All, I have a mainform that hold a template for house remodeling. Then I have a subform that holds the tasks needed to accomplish the house remodel. The subfrom is a list of continuous records. On particular fields in the subform, I use an append query to add records as needed. The problem is that once the append takes place the cursor goes back to the first record. How do I get the cursor to stay on the new appended record. ...
1
19770
by: Simon van Beek | last post by:
Dear reader, After same changes it is required to requery (refresh) query in a sub form. The code below is not working:
0
8921
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9284
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9202
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.