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

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
RefreshDatabaseWindow doesn't work

Anything along these lines?

Thanks for your help

Nov 13 '05 #1
4 5624
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.RecordSource = "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
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...
6
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...
3
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...
1
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...
1
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...
1
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...
3
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...
7
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...
1
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
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
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.