Need to update one form based on another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

sNote- I posted this email yesterday, but I didn't get any responses that
solved the problem. Can someone help?

I've searched this forum and tried several of the suggestions here to fix
this problem, but I still can't make it work. Hoping someone can help.

I have a main form (fClientFile) with several tabbed forms. One is fClient.
On fClients I have a subform called fIndustryView. I also have a command
button which opens another form called fIndustryAdd. When I click on the
command button to open fIndustryAdd, I can add/change/delete industry types.
I want these changes to be seen immediately in the subform fIndustryView.

Currently, when I change an existing record in fIndustryAdd, the change
reflects immediately in fIndustryView. I was able to accomplish this much by
having the event procedure:

Private Sub IndustryID_AfterUpdate()
Me.Dirty = False
End Sub

on the "after update" for the control IndustryID on the form fIndustryAdd.
However, additions or deletions are not reflected until I close fClientFile
and then reopen.

I've tried various suggestions I've found in this forum, but either they
don't solve my problem or I don't understand how to apply them. I am new to
Visual Basic, so any help should be explained at a very basic level.

Thanks in advance for any help anyone can give.
 
Currently, when I change an existing record in fIndustryAdd, the change
reflects immediately in fIndustryView. I was able to accomplish this much by
having the event procedure:

Private Sub IndustryID_AfterUpdate()
Me.Dirty = False
End Sub

on the "after update" for the control IndustryID on the form fIndustryAdd.
However, additions or deletions are not reflected until I close fClientFile
and then reopen.

Just add a line

Forms!fIndustryAdd.Requery

after the Me.DIrty = False line; or if you just want to requery a
combo box,

Forms!fIndustryAdd.comboboxname.Requery

John W. Vinson[MVP]
 
Thanks, but that didn't change anything. I added it to the After Update for
both the control and the form and nothing changed. Updates are still
immediately reflected when I change the selection, but to see additions or
deletions I have to close fIndustryAdd and close fClientFile. When I reopen
fClientFile, the additions or deletions are reflected. What am I doing wrong?
I have to do this same step in multiple places on my forms and this problem
has stopped my development work. Thanks for any help you can give!
 
Thanks, but that didn't change anything. I added it to the After Update for
both the control and the form and nothing changed. Updates are still
immediately reflected when I change the selection, but to see additions or
deletions I have to close fIndustryAdd and close fClientFile. When I reopen
fClientFile, the additions or deletions are reflected. What am I doing wrong?
I have to do this same step in multiple places on my forms and this problem
has stopped my development work. Thanks for any help you can give!

If you want the changes to be reflected on fClientFile, then you must
requery fClientFile. I misunderstood, it seems, when I suggested
requerying fIndustryAdd.

John W. Vinson[MVP]
 
Back
Top