473,396 Members | 1,879 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,396 software developers and data experts.

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.

Programmatically, 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 1375

"Ben" <Be*@discussions.microsoft.comwrote in message
news:1B**********************************@microsof t.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.

Programmatically, 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*@discussions.microsoft.comwrote in message
news:1B**********************************@microsof t.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.

Programmatically, 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*@discussions.microsoft.comschreef in bericht
news:1B**********************************@microsof t.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.

Programmatically, 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
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...
2
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...
0
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...
1
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...
1
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...
1
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...
5
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...
1
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...
10
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) =...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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,...
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
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...

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.