?
Solved

Where do i store output data from module?

Posted on 2009-05-02
8
Medium Priority
?
157 Views
Last Modified: 2012-05-06
As the title says.

Lets say i have this module:

public sub answer(byval number as integer)
number = number + 1
end sub

I want to make something as

if answer = 5 then
'do something
end if

Hope i was clear and you can help

(This is Visual basic.net, dont know if that category exist, so i put it in vbs category)
0
Comment
Question by:XabdullahX
  • 4
  • 2
  • 2
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24287443
> Zones:
>Visual Basic Programming, Microsoft Visual Basic.Net

so, all is right...


in regards to the question, where is the problem:

public sub answer(byval number as integer)
  number = number + 1
 
 if answer = 5 then
  'do something
 end if
 
end sub

Open in new window

0
 

Author Comment

by:XabdullahX
ID: 24287511
This code should be in the module1.vb
public sub answer(byval number as integer)
  number = number + 1


My question is, how do i use this:

 if answer = 5 then
  'do something
 end if

on my form1 ?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24287542
>on my form1 ?
hmmm, can you explain that?

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:XabdullahX
ID: 24287607
I made a simple example:

Here is the picture:

http://i.arcadeskillz.com/pics/Unavngivet417.JPG
0
 
LVL 11

Accepted Solution

by:
srikanthreddyn143 earned 375 total points
ID: 24288058
Make 'thing' Public variable and keep it as global variable

Now you can access 'think'
0
 

Author Comment

by:XabdullahX
ID: 24288154
Nice thx
0
 
LVL 11

Expert Comment

by:srikanthreddyn143
ID: 24288379
XabdullahX, why B Grade?
0
 

Author Comment

by:XabdullahX
ID: 24289192
Because you dont tell me the exact code, only what to do, so i googled public variables a bit and found the solution :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question