Connecting Tech Pros Worldwide Help | Site Map

Writing values from unbound controls after record navigation in subform

 
LinkBack Thread Tools Search this Thread
  #1  
Old April 14th, 2006, 01:35 AM
planetthoughtful
Guest
 
Posts: n/a
Default 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


  #2  
Old April 14th, 2006, 02:05 AM
planetthoughtful
Guest
 
Posts: n/a
Default Re: Writing values from unbound controls after record navigation in subform

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.