473,597 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing values from unbound controls after record navigation in subform

Hi All,

I have a mainform with a subform in which I show some task summary
data.

On the mainform I have a number of unbound controls that reflect values
relevant to each task in the subform. The unbound controls are
populated in the subform's OnCurrent even from a number of different
tables related to the records in tbl_tasks, which is the recordset
displayed in the subform.

My goal is that users should be able to change the values in the
unbound controls on the mainform, and then when the user navigates to
another record in the subform, the following should happen:

- determine if values in unbound controls on mainform have changed
(currently, I set the mainform's 'Dirty' property to true when any of
the unbound control values are changed)

- update the relevant tables to reflect changed values associated with
the 'navigated from' record

- retrieve and populate the unbound controls with the values associated
with the 'navigated to' record

I know I can achieve this by having the unbound controls uneditable
until an 'edit values' button is clicked, which I would use to disable
the subform. Then, when the user clicks 'save changes', I'd write the
values to the tables, disable the unbound controls again, and enable
the subform allowing navigation.

I'm just wondering is there's a way that simulates the feel of editing
values in a datasheet etc, where navigating to the next record
automatically writes any changes in the 'navigating from' record.

Any help appreciated!

Much warmth,

planetthoughtfu l
---
"Lost in thought"
http://www.planetthoughtful.org

Apr 14 '06 #1
1 3063
Not to worry, I think I worked this question out.

Essentially, I've put an unbound and invisible control on my mainform
which contains the task id of the record in my subform. In my subform's
OnCurrent event I check to see if the mainform is dirty, and if so I
perform the appropriate table updates using the values in the unbound
controls on the mainform. Once completed, I update the unbound controls
with the current record's values (including the task id of the current
record in the subform), ready to be updated etc, and set the mainform's
dirty property to false.

I don't know if this is going to run into event clash, but it seems
like it should address the issue.

Thanks to all.

Much warmth,

planetthoughtfu l
---
"Lost in thought"
http://www.planetthoughtful.org

Apr 14 '06 #2

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

Similar topics

4
3858
by: Tim Marshall | last post by:
This is an embarrassing question to which I should know the answer, but I am not 100% sure of myself. My applications, whether they are Jet or Oracle usually deal with reporting on existing apps that others have done and except for the odd single user app, I don't do many transaction type applications.... Anyways, I have an unbound form which is a data entry form for new records or in "add record" mode. Say this form is for creating...
3
3772
by: Dos Lil | last post by:
I have a unbound field in the subform(for calculating the datediff) which has the control property ==DateDiff("n",,). I have another unbound field in the main form which is for displaying the datediff from the subform.I have set the controls source = .Form! FRM- TimeSheet Subform is the name of the subform and TXTTtalHoursworked is the name of the unbound field in the subform.
0
8390
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record number changes fine. Within this main form I have a subform detailing distribution records for the contact (main form is based on this) that also has navigation buttons and a label showing Distribution 1 of ##. This is where the problem lies. The...
1
2978
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 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.
4
2708
by: Robert | last post by:
Have main form with an unbound subform1 which is used for data entry. Subform1 has a nested continuous unbound subform (subform2) which is used to enter multiple records related to the record being entered in subform1. Am using DAO method to save the records entered into subform1 & 2 into the underlying tables (table1 & table2). Record being entered in subform1 only gets its unique identifier when saved to underlying table (primary key...
20
10800
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of either an option button plus two text fields or a checkbox plus two text fields Am wanting to save the user entries into an underlying table. Tag property for each option button, check box or text field has the value of the key
2
7522
by: dancole42 | last post by:
So I have a subform that lists the various items on a particular invoice. First, the user selects a product class from the Class dropdown. This is bound to the Class field in the InvioceLines table. The rowsource for the combobox is: ClassName, ClassID, ClassSort from the Class table, with the bound column set to ClassID.
4
2899
by: virtualgreek | last post by:
Dear All, First of all I would like to take the time to thank you all for your efforts and time spent at this wonderful forum. I have found it very helpful with numerous examples available for every level of user. I am facing a rather weird behaviour with a combo box on a subform (Continuous form). I have two tables. Order and Order_Details. The master form is based on the Orders tables and the details form (subform) is based on the...
7
6782
by: ARC | last post by:
I've noticed that if you use code for the before update command for unbound controls, it doesn't really work. I tried the following: Me!ExportedYN.undo Cancel = True DoCmd.CancelEvent Exit Sub
0
7884
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
8267
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...
1
8024
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
8258
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
6681
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
3880
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
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
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.