Call a procedure in a parent form from a subform

D

Dennis

Hi,

I am trying to call the Display_Event procedure in my parent form of
frmMemberInfo from an event in a subform. I read the following link and
tried it, but I could not get it to work.

http://www.microsoft.com/communitie...&p=1&tid=efc2bfbe-c1c3-4a77-ba03-84517b143833

Here is the following lines of code that I tried in my sub-form and the
error I received for each:


frmMemberInfo.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
frmMemberInfo was highlighted with error msg Variable not defined.

frmMemberInfo.Form.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
variable not defined.

Parent.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
Application-defined or object-defined error

Parent.Form.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
Application-defined or object-defined error

I know that I spelled the form name correctly because I copied it from the
list of forms.

I would appreciate any assitance. I know it is simple, but I don't know
what I'm doing wrong or how to fix it.

Thanks,



Dennis
 
S

Stuart McCall

Dennis said:
Hi,

I am trying to call the Display_Event procedure in my parent form of
frmMemberInfo from an event in a subform. I read the following link and
tried it, but I could not get it to work.

http://www.microsoft.com/communitie...&p=1&tid=efc2bfbe-c1c3-4a77-ba03-84517b143833

Here is the following lines of code that I tried in my sub-form and the
error I received for each:


frmMemberInfo.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
frmMemberInfo was highlighted with error msg Variable not defined.

frmMemberInfo.Form.Display_Event
("frmMemberInfo_sf.cbRptHistNextTab_Click")
variable not defined.

Parent.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
Application-defined or object-defined error

Parent.Form.Display_Event ("frmMemberInfo_sf.cbRptHistNextTab_Click")
Application-defined or object-defined error

I know that I spelled the form name correctly because I copied it from the
list of forms.

I would appreciate any assitance. I know it is simple, but I don't know
what I'm doing wrong or how to fix it.

Thanks,



Dennis

Try:

Me.Parent.Form.Display_Event "frmMemberInfo_sf.cbRptHistNextTab_Click"
 

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