Home All Groups Group Topic Archive Search About

Cascade changed data in open forms

Author
12 Apr 2006 11:43 PM
Bryan
What are some of the methods you guys have used to update data in forms
that has been changed by another open form?  For example I might open
an form to edit an employee, and when I close it I would want to update
any comboboxes or listboxes that might contain a list of employees.  In
MS Access I used to handle this by looping through all open forms, then
looping through all listbox or combobox controls and calling their
..requery method.  I'm writing a new app in VB 2005 and was
brainstorming some ways to handle my data syncing needs.  I want to do
something that is reusable throughout the app.  For the example above I
know that I can explicitly update the controls, and I could even limit
this to happen only if that specific form is open.  However I want a
system where i can call a sub and it knows if any open forms need to be
'refreshed'.  Maybe I could keep some sort of control collection with
control names and the nature of the data that they hold.  Any
suggestions to get me started?

Author
13 Apr 2006 10:46 PM
tomb
Bryan wrote:

Show quoteHide quote
>What are some of the methods you guys have used to update data in forms
>that has been changed by another open form?  For example I might open
>an form to edit an employee, and when I close it I would want to update
>any comboboxes or listboxes that might contain a list of employees.  In
>MS Access I used to handle this by looping through all open forms, then
>looping through all listbox or combobox controls and calling their
>.requery method.  I'm writing a new app in VB 2005 and was
>brainstorming some ways to handle my data syncing needs.  I want to do
>something that is reusable throughout the app.  For the example above I
>know that I can explicitly update the controls, and I could even limit
>this to happen only if that specific form is open.  However I want a
>system where i can call a sub and it knows if any open forms need to be
>'refreshed'.  Maybe I could keep some sort of control collection with
>control names and the nature of the data that they hold.  Any
>suggestions to get me started?
>

>
Bind the controls to the dataset.  When you update in one form, the
other form will already have the updated data.

Tom