RaiseEvents between forms?

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

I would like to communicate between two forms. For example, if I
add/change/delete a record in the Employee form, I would like to ensure that
a list on the Find form is update to reflect this action. While I don't
have other forms that need to be notified, I would like to implement a
solution that would allow this to occur.

I was considering raising an event from the Employee form that would be
captured by the Find form. But this requires me to declare the Employee
form withevents in the Find form.

I suppose that I could have a hidden form.

Is there a better way?

Thanks,

Craig Buchanan
 
Craig,

I recall some time ago seeing some code to send messages to different
windows, but it involved subclassing, and was non-trivial.

Another method might be to create an object reference to the target form
(provided it is already open), using the following syntax:
Dim frm As Form
Set frm = Forms!frmFind
frm.lstMyListBox.Requery
Set frm = Nothing

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
....or more simply...
Forms!frmFind!lstMyListBox.Requery

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top