Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.parent (forms)

Status
Not open for further replies.
Joined
Mar 31, 2003
Messages
22
Location
EU
Hi,

I have some code,

Sub

Dim Parentform as Form, Childform as Form
Set Parentform = Me.Parent
Set Childform = Forms!sfrmChild

If Parentform = Childform
..
..
EndSub

Getting error stating that Forms!sfrmChild is not found and Parentform = Childform (type mismatch). is there something silly i´m doing here.

Thanks, Jimmy
 
Hi,

This really depends on where you are calling this code from.

I take it the sfrmChild is a sub form on the parent form?
If so, and you call the code from anything other than the child form, then

Set Childform = Forms!sfrmChild

will not find it.

You need:

set Childform = forms!parentformname!sfrmchild.form

Or there abouts.
Look at 'subform reference' in Access help (.form is important).

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top