Hi,
i think you have instantiate a form using its class:
dim frmSearch as Form_Search
set frmSearch = new Form_Search
frmSearch.visible=true
Also you can try to use form's open event (but i am not sure)
Set frmSearch = Form_Search
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Dirk" <(E-Mail Removed)> wrote in message
news:4305B5D8-711E-40E8-B3BD-(E-Mail Removed)...
> 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?
>