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

Simplest Issue

Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module
it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?
Nov 20 '05 #1
6 966
ehh
Public pricing1 as String
MsgBox(price1)

have a look at the names

and try giving it a value
in your module :
Public price1 As New String("test")

"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module
it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?

Nov 20 '05 #2
The form procedure should read:

Sub GetPricing
getprice1
msgBox(price1)
End Sub

Sorry about that typing on the fly.

"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module
it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?

Nov 20 '05 #3
"scorpion53061" <sc****************************@yahoo.com> schrieb
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
price1 is not defined. Do you use Option Strict, or at least Option
Explicit?
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.
Resolved to the same variable? Right-click on variable name in the event
handler and select "go to definition". Same in the Msgbox line in the
module.
I also have noticed when I try to format a string not declared in a
module it says "object reference to a non shared member requires an
object reference."
Right.
I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......


Yes, everything in a module is implicitly declared as shared.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Scor,

Not really sure how this will work unless you declare price1 at the module
level for instance

Module mystuff
Public price1 As String

Public Sub getPrice1
price1="100"
End Sub
End Module

In the from:

Public Class myFrom
Inherits System.Windows.Forms.Fom

Sub getPricing
mystuff.getPrice1() 'Note mystuff. is not necessary but adds to
readability
Msgbox(mystuff.price1)
End Sub
End Class
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module
it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?

Nov 20 '05 #5
It should have said:

In module 1....

Public price1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
getprice1
MsgBox(price1)
End Sub

The question is why the value shows in the message box of the sub in the
module but not in the message box of the form.

Armin and Solex the headers for your response came on my server but not the
text of your message. Please repost and thanks.

"EricJ" <ericRéMo**@ThiSomnipack.be> wrote in message
news:3f*********************@reader5.news.skynet.b e...
ehh
Public pricing1 as String
MsgBox(price1)

have a look at the names

and try giving it a value
in your module :
Public price1 As New String("test")

"scorpion53061" <sc****************************@yahoo.com> wrote in message news:u9**************@tk2msftngp13.phx.gbl...
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?


Nov 20 '05 #6
Here is the repost:

Scor,

Not really sure how this will work unless you declare price1 at the module
level for instance

Module mystuff
Public price1 As String

Public Sub getPrice1
price1="100"
End Sub
End Module

In the from:

Public Class myFrom
Inherits System.Windows.Forms.Fom

Sub getPricing
mystuff.getPrice1() 'Note mystuff. is not necessary but adds to
readability
Msgbox(mystuff.price1)
End Sub
End Class

"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It should have said:

In module 1....

Public price1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
getprice1
MsgBox(price1)
End Sub

The question is why the value shows in the message box of the sub in the
module but not in the message box of the form.

Armin and Solex the headers for your response came on my server but not the text of your message. Please repost and thanks.

"EricJ" <ericRéMo**@ThiSomnipack.be> wrote in message
news:3f*********************@reader5.news.skynet.b e...
ehh
Public pricing1 as String
MsgBox(price1)

have a look at the names

and try giving it a value
in your module :
Public price1 As New String("test")

"scorpion53061" <sc****************************@yahoo.com> wrote in

message
news:u9**************@tk2msftngp13.phx.gbl...
Is driving me nuts

In module 1....

Public pricing1 as String

Sub getPrice1
'do this to get price 1
price1 = "100"
MsgBox(price1)
End Sub

in the event procedure of the form

Sub getPricing
MsgBox(price1)
End Sub

The message box in the module produces the string.

The message box in the event procedure shows it is empty.

I also have noticed when I try to format a string not declared in a module it says "object reference to a non shared member requires an object
reference."

I tried sharing the sub in teh module and it wont allow that.

Modules are all about sharing......

anyone have ideas?



Nov 20 '05 #7

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

Similar topics

3
by: mimages | last post by:
What's the SIMPLEST way to sell on a site? I am looking into osCommerce, but the amount of setup and configuration is overwhelming. I just want to take an existing site, dedicate a cell or two in a...
5
by: dave | last post by:
How would I go about creating the simplest routine in VB 6.0 to have a user E-Mail me the application name, date installed and his/her E-Mail Address ?
1
by: zbcong | last post by:
hello there are two ListViews with the SAME coloumns within one winform,i want to move the data from one ListView into other one,what is the simplest method? thank you!!
3
by: Quentin Huo | last post by:
Hi: When I tried the following code, I got an error: if I clicked "Click me" button more than one time, and than click "back" button in the IE browser Toolbar, I will get an error: "The page...
9
by: Alan Silver | last post by:
Hello, I would like to be able to use an URL like ... http://www.whatever.com/order/123 and have it translated into ... http://www.whatever.com/orders.aspx?orderid=123
4
by: Alan Silver | last post by:
Hello, I have a site that stores some info in an XML file. The file is pretty simple, of the form... <Site> <SiteName>Fred's Ferrets</SiteName> <SomeVar>Whatever</SomeVar> .... etc ......
3
by: | last post by:
For a given web form, I want to know what the +simplest+ way to add an attribute to all of a particular control type on that page. For example, I might want to add an onClick attribute to all...
82
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
1
by: Dave Johnson | last post by:
greetings, can anyone show an example of aggregation in any .net code vb.net or C# i guess it shouldnt be that hard but i searched a lot without finding anything that explains the...
1
by: giannis | last post by:
I want when i click on a button "fill" a DataGridView with data from a "SELECT" SQL clause. What the simplest way to achieve this work with the use of the available bindingSource (without make...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.