473,804 Members | 3,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

public variable not public

I have a class, and a public varible defined in one of the
..VB files of that class.

I also have a form in that class, but I cannot
reference the variable in the class from the form,
even though the form is in the class.

Thanks in Advance,

Laurence Nuttall
Programmer Analyst III
UCLA - Division of Continuing Education
Nov 20 '05 #1
2 987
Hi Laurence,

Show us some code - it should be simple to access the variable you refer to.

Bernie Yaeger

"Laurence Nuttall" <Bl***@Bliff.co m> wrote in message
news:e7******** ******@tk2msftn gp13.phx.gbl...
I have a class, and a public varible defined in one of the
.VB files of that class.

I also have a form in that class, but I cannot
reference the variable in the class from the form,
even though the form is in the class.

Thanks in Advance,

Laurence Nuttall
Programmer Analyst III
UCLA - Division of Continuing Education

Nov 20 '05 #2
A riddle, wrapped in a mystery inside an enigma.
Sorry Laurence you might have to post again.
I cant work out what your saying.
I have a class, and a public varible defined in one of the
.VB files of that class.
Generally you only have one .vb file per class. In fact i thought you
could ONLY have 1 vb file per class. How many do you have?
I also have a form in that class, but I cannot
reference the variable in the class from the form,
even though the form is in the class.


A form is a class. Is that what you mean? You wouldn't declare a form
inside another class, i dont see when nesting in way would make sense
and i know the designer would throw a hissy.

Post a little code, or check your namespaces and the scope on your
Class with the public variable.

hth
Richard
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4998
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class pointer which points to an instance of a derived class, but when I pass that base class pointer into a function, it can't access the derived object's public functions. Although, the base class pointer does call the appropriate virtual function...
10
5793
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this (also copied below for easier reference): http://groups.google.it/groups?hl=en&lr=&safe=off&selm=6beiuk%24cje%40netlab.cs.rpi.edu&rnum=95 I don't agree anymore.
2
1729
by: THY | last post by:
Hi, I am having some problem, I declare few variable in a public module and use them in the web application. But after that I found that the variable declared in public variable = application("variable"), and it will be shared by all user ... but I am not very sure about it, anyone know it ? Thanks, Tee
10
3681
by: darrel | last post by:
I'm still trying to sort out in my head the differences between public and shared when referring to declaring properties or variables. This is my understanding: shared - akin to a 'global' variable for the application. Any other code within the application can access it. public - can be shared across the application if instatiated. Does that sound about right? It seems these are more useful for methods rather than variables. Most of...
3
30115
by: Tor Inge Rislaa | last post by:
How to use a public variable In VB.6.0 I could in the declaration part of a form declare a public variable, then assign a value to the variable, open a new form and address the variable and read it's value in my new form. Form1:
5
8433
by: Neil Steventon | last post by:
Hi, I am new to VB.net , well the objects concept anyway and was wondering if there were any good articles / turorials on when and why you would use certain declarations such as Private test as string public test as string Public Shared as string Protected test as string
9
8877
by: Stefan De Schepper | last post by:
Should I use: Private m_Name As String Public Property Name() As String Get Return m_Name End Get Set(ByVal Value As String) m_Name = Value
7
2083
by: Steve Mauldin | last post by:
I have a public variable that is declared in a public module. This Variable is stored into a Session variable and used to pass data from page to page. I am seeing on my local development box that once the variable is created and loaded with data and stored into the session variable that on the next aspx page, before the first line of the page load is executed, the public variables data persists. I have not done an assignment from the...
11
1944
by: dgk | last post by:
If I have a class with a public variable, isn't this the same as a private variable with a property? ie, isn't this: Public Class MyTest Public MyVar as String End Class the same as this: Public Class MyTest
10
2678
by: timber910 | last post by:
OK, I've searched all over and used the help on the VBA editor. Helped a little but I'm not getting close enough to see where I'm going wrong. I need a public variable that I will be able to use on different forms as part of the join property in a SQL statement. I think it would easier to make it a public so I don't have to create the variable in every button it might be used in. Here is what I've come up with so far. While I get no errors...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.