473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Forms access null exception.

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
1 1009
ambusy
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

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

Similar topics

4
by: Charlie Williams | last post by:
I am having difficulty performing updates and deletions on an Access database using the Update() method of the OleDBDataAdapter. I can insert rows without a problem, but I get a concurrency...
1
by: Jim | last post by:
I am experiancing a problem filling a dataset. I am getting a Value cannot be null exception and can't figure out why. Here is the code what the heck could be going on? Dim conn As New...
0
by: Rishabh.Dayal | last post by:
Hi, I always get a null exception while using XPATH Saxon-8b. I am using this for the first time. My xml document is: <foo xmlns="default-namespace"> <ns1:bar xmlns:ns1="namespace1-uri"...
0
by: George | last post by:
Hi, The storeprocedure fails with null exception on the DB2 development centre for SELECT querys for all tables that has the number of columns greater than 10. Strange ,but true ..i reinstalled...
2
by: Adam Knight | last post by:
Hi all, The following code works fine. If i remove the try statement, i recieve a generic is null exception when trying to retrieve a datagrids data item. With the try those exceptions are...
2
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for...
1
by: Lee | last post by:
Hi all, been playing with some code overriding WndProc to get information about mouse events. So far I've tried to capture when the left mouse button is pressed using the code below. Sometimes...
1
by: connor7777 | last post by:
Hi guys: We've been weeding out errors off of a java->c# project and have managed to redeem most of our code with the exception of one bug that we for some reason cannot pin down. The following...
1
by: Kirzak pascuale | last post by:
ok I made this exercise, for a compiler design course. it is not urgent as the assignment was due 2 days ago. i got a 4 out of 10 for effort. mainly because i did not just rehash code examples from...
3
by: =?Utf-8?B?eGJsZXNzaW5n?= | last post by:
Hello, I'm trying to communicate with a TEC Controller Newport 350B using their ..dll and VB.NET. I was able to use their example code with VB6. However, I've got following error when using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.