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

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,

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

Apr 14 '06 #1
1 3049
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,

planetthoughtful
---
"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
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...
3
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...
0
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...
1
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...
4
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...
20
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...
2
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...
4
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...
7
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...
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
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
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
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
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...

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.