G
Guest
Hi,
I have this form I use to look for contacts and it uses the following event:
Public Event ContactSelected(nCNT_ID As Integer)
Whenever a contact is selected the following code is ran to raise the event
and pass the ID of the selected contact:
RaiseEvent ContactSelected(CNT_ID.Value)
On my calling form I declare a form like:
Public WithEvents frmSearch As Form
To try and catch the event this form raises I use something like:
DoCmd.OpenForm("Search")
Set frmSearch = Forms("Search")
I am also using a sub to try and catch the event but this doesn't seem to
ever get called even though I do raise the event.
Public Sub frmSearch_ContactSelected(nCNT_ID As Integer)
Me.nCNT_ID = nCNT_ID
MsgBox "Found: " & nCNT_ID
End Sub
Please does anyone know how to catch a form's custom event?
I have this form I use to look for contacts and it uses the following event:
Public Event ContactSelected(nCNT_ID As Integer)
Whenever a contact is selected the following code is ran to raise the event
and pass the ID of the selected contact:
RaiseEvent ContactSelected(CNT_ID.Value)
On my calling form I declare a form like:
Public WithEvents frmSearch As Form
To try and catch the event this form raises I use something like:
DoCmd.OpenForm("Search")
Set frmSearch = Forms("Search")
I am also using a sub to try and catch the event but this doesn't seem to
ever get called even though I do raise the event.
Public Sub frmSearch_ContactSelected(nCNT_ID As Integer)
Me.nCNT_ID = nCNT_ID
MsgBox "Found: " & nCNT_ID
End Sub
Please does anyone know how to catch a form's custom event?