RaiseEvents between forms?

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
 
G

Graham R Seach

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
 
G

Graham R Seach

....or more simply...
Forms!frmFind!lstMyListBox.Requery

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 

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

Top