473,769 Members | 3,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Requery unbound listbox on master forces requery of subforms?

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 aspects of the project. On the masterform I have
two unbound listboxes that I populate with information regarding the
current record in one of the subforms.

The subform tracks which employees have been assigned to the project
in question, and one listbox shows the assets that have been assigned
to the current employee, and the other listbox shows the assets that
are still available to be assigned to that employee.

Double clicking on an entry in the listbox that shows the assets that
have yet to be assigned to the employee inserts a record into an
associative table that the other listbox draws from to indicate that
the asset has now been assigned to the employee. When I requery the
2nd listbox, as part of the double-click event on the first listbox,
to show now the newly assigned asset, for some reason Access is
forcing a requery of all the subforms on the form, sending them all
back to the first record in their recordsets.

I can't figure out why this is the case, and I'm now wondering if
there's a way of refreshing a listbox's contents without requerying
the subforms?

Any help immensely appreciated!

Much warmth,

Murray
Nov 12 '05 #1
1 2992
On Sun, 09 May 2004 20:02:04 -0400, M Wells <pl**********@p lanetthoughtful .org> wrote:
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 aspects of the project. On the masterform I have
two unbound listboxes that I populate with information regarding the
current record in one of the subforms.

The subform tracks which employees have been assigned to the project
in question, and one listbox shows the assets that have been assigned
to the current employee, and the other listbox shows the assets that
are still available to be assigned to that employee.

Double clicking on an entry in the listbox that shows the assets that
have yet to be assigned to the employee inserts a record into an
associative table that the other listbox draws from to indicate that
the asset has now been assigned to the employee. When I requery the
2nd listbox, as part of the double-click event on the first listbox,
to show now the newly assigned asset, for some reason Access is
forcing a requery of all the subforms on the form, sending them all
back to the first record in their recordsets.

I can't figure out why this is the case, and I'm now wondering if
there's a way of refreshing a listbox's contents without requerying
the subforms?

Any help immensely appreciated!

Much warmth,

Murray


Instead of using the LinkChild and LinkMaster properties of the subform controls to sync the subforms with the main
form, add a reference to the relevant control on the main form, in the criteria line of the subforms recordsource.
Say for example you have EmployeeID set in the LinKChild / Master properties of a subform, delete these properties and
in the criteria line of the subforms recordsource under EmployeeID put something like Forms!frmMyMain Form!EmployeeID .

You will have to do the requerying of the subforms in code (Me.frmMySubfor m1.Form.Requery ) when ever you need the
subform contents to be updated, (OnCurrent etc) but the subforms will stay put until you decide to requery them.

If you use the LinkChild and LinkMaster properties, Access decides when to requery the subforms which may not always be
when you want them requeried, especially if you have multiple subforms. I rarely use the LinkChild and LinkMaster
properties anymore because I find this behaviour a real PITA.
Wayne Gillespie
Gosford NSW Australia
Nov 12 '05 #2

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

Similar topics

1
1969
by: Chris Belcher | last post by:
I have a unbound form with 2 subforms. It looks something like this _______________________________________________ | | | | | | | AIKey Other Data | Detail | | AIKey Other Data | Detail | | AIKey Other Data | Detail | | AIKey Other Data | Detail | | AIKey Other Data | Detail |
4
7018
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
3
2096
by: Oliver Spiesshofer | last post by:
Hi, I have an unbound form with two bound subforms. If data in one of the subforms is updated, I want the other one to be requeried. How do I do that? I tried the a function doing
1
3256
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 the ID field on the subform (so the main form can tell which record on the subform is selected). Three command buttons allow the user to manipulate records that are displayed in the subform (Add, Edit, Delete). After the user executes on of...
1
2507
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 think--newbie here). Now I need the second subform (subAccount) to update when I add a visit in the subVisits subform. I assume that the AfterUpdate would do it, but I cant figure out what the code is to update another subform would be. Not...
2
1923
by: Swinky | last post by:
Can someone explain to me the proper syntax for requery and where to input it in my form? I have a main form "Account-Master" with two subforms: 1.) Contacts and 2.)TNotes. The TNotes subform has a list of notes related to the Account-Master record (a relationship has been established based on the field CompanyID which exists in both tables).
11
1985
by: The Frog | last post by:
Hi all, Maybe I am just missing something simple here, but I seem to have an issue with a callback function in A97 that is used to fill a Listbox with values. The first time the callback function is used (when the form opens) all runs well and everyone is happy. Then comes the problem - values are added to the recordset (ADO) that the callback function uses to populate the listbox. After the new values are added to the recordset, the...
5
2822
by: vegeta456 | last post by:
I am trying do display some data in a continous subform which is part of an unbound form. The master form is supposed to display a error discription window. To do this I call the following sub procedure Public Sub display_error_payadvice( LegacyEmpNumber As String, FullName As String, EmployeeNumber As String ) DoCmd.OpenForm "ErrorPayAdvice" Forms!ErrorPayAdvice. = EmployeeNumber Forms!ErrorPayAdvice. = FullName
3
5494
by: Kan09 | last post by:
i'm having a problem with the requery and move to last command on some subforms. The subforms are used to view the data enterd into the table. I have 3 forms that use subforms. On 2 of the subforms the requery is made and the data can be seen on the subform ,but the subform does not go to the las record enterd, the user having to search for it.The data seems to updated by user...but there is no ordery by statement. On one form the requery +...
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9851
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...
1
7403
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5293
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...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2811
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.