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

Simple Module/Variable Question

Hi,

a Simple Question, I have some code at my form, the code in the form is
calling a certain module and execute some code, a certain variable is set to
strTemp. but when de module is done. I still like to use that variable
strTemp in the code of my form ?

How ?
Thx
Nov 12 '05 #1
2 1748
As answered in microsoft.public.access.modulesdaovba. Please "cross-post"
not "multi-post" (I hope I didn't get them backwards). If posting to
multiple groups, post to them all simultaneously by listing all of them at
once in the "To" field. This way when someone replies, their replies go to
all of them at once also.
There are several ways to get the value back to your form.

1) Increase the "scope" of the variable by changing where you are declaring
it. If you declare it in the modules Declarations section you will make it a
"global" variable that is available throughout your application.

2) Use parameters passed ByRef (the default for VBA) when you call the
function. Assign the value of strTemp to one of these parameters. This will
change the value for the variable that correlates with that parameter when
calling procedure .

3) Have the routine in the module assign the value of strTemp to a control
on the form. You can then retrieve the value from that control when you
return to the form.

--
Wayne Morgan
Microsoft Access MVP
"TNGgroup" <tn*@tnggroup.com> wrote in message
news:3f***********************@news.skynet.be...
Hi,

a Simple Question, I have some code at my form, the code in the form is
calling a certain module and execute some code, a certain variable is set to strTemp. but when de module is done. I still like to use that variable
strTemp in the code of my form ?

How ?
Thx

Nov 12 '05 #2
I missed one.

4) Change your procedure from a Sub to a Function. Assign strTemp to be the
return value of the function.

--
Wayne Morgan
Microsoft Access MVP
Nov 12 '05 #3

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

Similar topics

8
by: Phil D | last post by:
Hi, I am new to c# and oop and have a question about interfaces which I hope someone can help me with. The book I am using (C# Step by Step) explains how to create and implement interfaces...
8
by: Floris van Haaster | last post by:
Hi All! I have a question, i have a web application and I store some member information in a variable i declared in a module like: Public some_info_variable as string in module1.vb But...
13
by: peter hansen | last post by:
in VB6 it was possible to load and unload forms - how do I do this in VB.NET :D I think I have been almost everywhere // Peter
0
by: Fredrik Lundh | last post by:
Jeff Dyke wrote: so how did that processing use the "mymodulename" name? the calling method has nothing to do with what's considered to be a local variable in the method being called, so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...

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.