|
-
Sep 21st, 2000, 10:33 AM
#1
Thread Starter
Hyperactive Member
Can anyone tell me how to set a string globally?
Many thanks
-
Sep 21st, 2000, 10:37 AM
#2
Fanatic Member
Form wide - Put the line with "dim" in the general declarations section
Project wide - Put this line in a module
Code:
Public WhatEver As String
-
Sep 21st, 2000, 10:49 AM
#3
Thread Starter
Hyperactive Member
FORM WIDE?
Whats form wide? i'm not really VB man?
Many Thanks
-
Sep 21st, 2000, 10:58 AM
#4
Frenzied Member
oetje is talking about scope.
If you want your variable to be accessed and changed from ANYWHERE in your project (all forms, classes, modules, ect.) then declare it as Public in a module.
If you want your variable to be accessed and changed from any procedure in a form, but NOT the other forms/modules in your project then declare it Private (or Dim) in the General Declarations section of the form only.
Generally you want to give your variables as little scope as necessary so that they are safe from being changed by those who have no business changing them.
Hope that helps,
-
Sep 21st, 2000, 11:51 AM
#5
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|