473,794 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error message in vb2005

Hi all,

I am new to vb2005. I have two list boxes on a form. one on the left and
the other on the right. The left contains a list of items. Between the two
list boxes I have a button to add selected items in the left list box to the
right list box.

Programmaticall y, I need to item I am trying to add from the left list box
is not already in the right list box so as not to create a duplicate entry.
When I click on the add button, it calls a function in a module to verify
that the item in the left list box is not already in the right list box. But
I got the following message, and I have not a clue what I need to resolve
this:

"Reference to a non-shared member requires an object reference."

Can you share some thoughts with me on this? Thanks in advance.
Ben

--

May 23 '07 #1
3 1386

"Ben" <Be*@discussion s.microsoft.com wrote in message
news:1B******** *************** ***********@mic rosoft.com...
Hi all,

I am new to vb2005. I have two list boxes on a form. one on the left and
the other on the right. The left contains a list of items. Between the
two
list boxes I have a button to add selected items in the left list box to
the
right list box.

Programmaticall y, I need to item I am trying to add from the left list box
is not already in the right list box so as not to create a duplicate
entry.
When I click on the add button, it calls a function in a module to verify
that the item in the left list box is not already in the right list box.
But
I got the following message, and I have not a clue what I need to resolve
this:

"Reference to a non-shared member requires an object reference."

Can you share some thoughts with me on this? Thanks in advance.
Google is your friend.

http://www.google.com/search?hl=en&q...=Google+Search

May 24 '07 #2
Thanks.

Ben
--

"Mr. Arnold" wrote:
>
"Ben" <Be*@discussion s.microsoft.com wrote in message
news:1B******** *************** ***********@mic rosoft.com...
Hi all,

I am new to vb2005. I have two list boxes on a form. one on the left and
the other on the right. The left contains a list of items. Between the
two
list boxes I have a button to add selected items in the left list box to
the
right list box.

Programmaticall y, I need to item I am trying to add from the left list box
is not already in the right list box so as not to create a duplicate
entry.
When I click on the add button, it calls a function in a module to verify
that the item in the left list box is not already in the right list box.
But
I got the following message, and I have not a clue what I need to resolve
this:

"Reference to a non-shared member requires an object reference."

Can you share some thoughts with me on this? Thanks in advance.

Google is your friend.

http://www.google.com/search?hl=en&q...=Google+Search

May 24 '07 #3
Ben,

The reason for this can be many however finds its base in object oriented
programming.

If we forget shared which has nothing to do with objects than you make
yourself an object using the keyword "new".

This can be global to your program (not project) by typing it outside a
methode or dedicated to a method, which will be out of scope (destructed) at
the end of the method.

In short.

private a as WhateverClass, creates a place to put your object in (only the
address, which is called the reference).
a = new WhateverClass, creates the object.

This can done as well in one time
private a as new WhateverClass

As long that the reference is filled you can use it in your program.

However for nice memory use you can as well put it in the method (I prefer
that not only because of memory use)

Dim and than the same as with the private.

However do you never construct with the "new" an object in that place you
will get the error you got.

Cor
"Ben" <Be*@discussion s.microsoft.com schreef in bericht
news:1B******** *************** ***********@mic rosoft.com...
Hi all,

I am new to vb2005. I have two list boxes on a form. one on the left and
the other on the right. The left contains a list of items. Between the
two
list boxes I have a button to add selected items in the left list box to
the
right list box.

Programmaticall y, I need to item I am trying to add from the left list box
is not already in the right list box so as not to create a duplicate
entry.
When I click on the add button, it calls a function in a module to verify
that the item in the left list box is not already in the right list box.
But
I got the following message, and I have not a clue what I need to resolve
this:

"Reference to a non-shared member requires an object reference."

Can you share some thoughts with me on this? Thanks in advance.
Ben

--

May 24 '07 #4

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

Similar topics

1
1279
by: thomasp | last post by:
I get the following error when closing VB2005 beta 2. Everything runs fine. Just wondering what the error is and how to eliminate it. ******** The control System.Windows.Forms.MdiClient has thrown an unhandled exception in the designer and has been disabled. Exception: Property accessor 'Locked' on object 'stsMain' threw the following exception:'Object does not match target type.'
2
1320
by: Jerry Spence1 | last post by:
1. Is there a more suitable, dedicated newsfeed for VB2005 yet? 2. I'm confused as to which version to get. I work for a small company and we will just need VB2005 on my PC. Therefore that tends to suggest the express version, but I write some pretty complicated stuff (including SQLServer transactions, network programming etc) and I am wondering what is missing from the Express version in terms of components, functionality etc. I don't...
0
2029
by: Rich | last post by:
Hello, I just upgraded a vb2003 app to vb2005. The vb2003 app had/has a statusbar object - which contains panels and I can see the properties of the statusbar in the properties window in vb2005. But in the tools list of vb2005 I do not see a statusbar selection. Instead I see a statusStrip, and even though the Items collection has a property to set the statusStrip labels to sunken, etched,... I can see these appearances when I...
1
1314
by: John Dann | last post by:
Running VB2005 on Windows XP SP2: I've started to get type initializer errors on Form1 whenever I try to run a project within the IDE - this never used to happen. I can open the project within the IDE and see all the code, it's just trying to run the app that triggers the error. Projects are stored on a network drive, which I'm fairly sure is the source of the problem. I'm guessing that some recent Windows Update download has changed...
1
1668
by: erickwan88 | last post by:
I am doing a final year project for my school and is going to provide for an organization, so I am asking for some help on here. Indeed, I have no idea on how to get the input from my pen driver and use on vb2005 as when I activate the pen driver, it will run its own program itself and when I deactivate it, it become a mouse. Therefore, I need to find out how to use the pen to write words on the vb2005 program instead of being either a...
1
4441
by: Jeffrey Christiansen | last post by:
I wanted to add a toggle button to a VB2005 form to be used for a simple Windows Application (i.e. compiled to a "*.exe"), so I added the ActiveX Microsoft Forms Object toggle button, however I can't get this button does work properly. The documentation I found in the FM20.CHM files says the button state can be determined from its "Value" property, but the property list shown in VB2005 does not have a "Value" property. How is the button...
5
3258
by: Al G | last post by:
Hi, I'm converting a bit of POP3 VB6 code to VB2005, and have run into this error with the following code. Can someone help me find out what I'm missing/doing wrong? 'holds the attachments Class attachmentBlockParameter
1
2252
by: Vae07 | last post by:
Ok so here is a brief summary of my problem. I need a pop up form that submits input text box information to a pocket excel workbook upon a command botton click. Text box inputs are checked for validity upon individual text box exit (don't have a problem with this part). All this could be done with Excel VBA easily, but pocket excel doesn't have VBA/Macro support. In as much, I have been trying to create a VB2005 application that I can load...
10
1185
by: zubair1 | last post by:
Hi, I pretty new to VB2005 i was just working on a project a problem arise which really got me frustrated. Dim searchThese(1) As String myvar(0) = "Hi" myvar(1) = "Bye" searchfolder(myvar as string)
0
9671
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
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10000
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
7538
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
6777
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
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
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
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
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.