Update Sub form as user enters data in main form

  • Thread starter Thread starter cableguy47905 via AccessMonster.com
  • Start date Start date
C

cableguy47905 via AccessMonster.com

I have a mainform that uses an unbound combo box to populate a subform. This
works great. This will display all of the existing data for my contracts.
If however they want to add more contracts, they enter the data on the main
form and after continueing on to the next record and selecting that company
from the combo box, they will see that their contract has been added to the
list.

I would like to be able to show the user the data they are entering into the
main form is also going directly into the subform as a new record without the
need of a command button or advancing a record. At one point I had this by
using a suggestion of putting Me.dirty = false in the after update event of
each field. I have made so many changes to my form now that it doesn't work
and I never understood what made it work in the first place. So, i can't
figure out how to fix it.

Can someone suggest another way?

Thanks,
Lee
 
First, loose that Me.Dirty = False code. That makes your form very
inefficient. The easy way to do it is to add one line of code to the After
Update event of the combo box you are using to populate the subform. After
everything else is done, of course:

Me!MySubform!Form.Requery
 
The combobox is the very first field that information is entered into. I
would like to update the subform after each field has been updated. I can do
this right?

Klatuu wrote:
The easy way to do it is to add one line of code to the After
 
How would I be able to do this?

I already have that code in the AfterUpdate of the combobox, but since it is
the first thing updated, it populates the subform first then I enter the rest
of the data.

Even if I could just refresh/requery the subform after all data is entered,
that would be better than having to advance to next record, and coming back
in order to see the subform updated.
Yes, but performance may suffer a little.
The combobox is the very first field that information is entered into. I
would like to update the subform after each field has been updated. I can do
[quoted text clipped - 5 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top