By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

Forms access null exception.

P: 29
Hi
This is stranged:

This first scenario works good!!!
==================================
FORM1
F3 AS NEW FORM3
F3.SHOWDIALOG()

FRIEND SUB METHOD()
F3.BACKCOLOR = AQUA <----- (WORKS FINE)
END SUB
===================================
FORM3
FORM1.METHOD()
===================================

This second scenario DOES NOT work !!!
===================================
FORM1
F2 AS NEW FORM2
F2.SHOWDIALOG()
===================================
FORM2
F3 AS NEW FORM3
F3.SHOWDIALOG()

FRIEND SUB METHOD()
F3.BACKCOLOR = AQUA <----- F3 IS NOTHING !!!! (EXCEPTION)
END SUB
===================================
FORM3
FORM2.METHOD()
===================================

Sorry for this poor explanation but it is 2:25 AM and I'm exhausted.

Thanks
Aug 9 '14 #1
Share this Question
Share on Google+
1 Reply


P: 5
When you write FORM2.METHOD() in F3, you (implicitly) create a new instance of FORM2, which DIMs an new instance of F3, and calls it's method METHOD. This instance knows NOTHING of the existence of other instances. You perhaps wanted the method METHOD of F2 executed on it's F3. If so make F2 and F3 Friend and you have no more problems
Aug 18 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.