Click here to Skip to main content
15,896,201 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Referencing Variables in Module1 Pin
Eddy Vluggen12-Sep-10 9:59
professionalEddy Vluggen12-Sep-10 9:59 
GeneralRe: Referencing Variables in Module1 Pin
Win32SF12-Sep-10 10:11
Win32SF12-Sep-10 10:11 
GeneralRe: Referencing Variables in Module1 Pin
Eddy Vluggen12-Sep-10 10:27
professionalEddy Vluggen12-Sep-10 10:27 
GeneralRe: Referencing Variables in Module1 Pin
Eddy Vluggen12-Sep-10 13:38
professionalEddy Vluggen12-Sep-10 13:38 
GeneralRe: Referencing Variables in Module1 Pin
Win32SF12-Sep-10 14:06
Win32SF12-Sep-10 14:06 
GeneralRe: Referencing Variables in Module1 Pin
ChandraRam17-Sep-10 2:23
ChandraRam17-Sep-10 2:23 
GeneralRe: Referencing Variables in Module1 Pin
Win32SF17-Sep-10 6:04
Win32SF17-Sep-10 6:04 
AnswerRe: Referencing Variables in Module1 Pin
ChandraRam12-Sep-10 11:28
ChandraRam12-Sep-10 11:28 
Variables declared within procedures ("sub") are not available to be referenced outside the procedure.

To make it available, declare it as

Public FormIndex as Integer

before the code for any procedure.

For instance, your Module1 code should look like this:
Option Explicit

Public FormIndex as Integer

Public Sub AddMenus()
Dim ReportViewName(2 To 4) As String
‘create menu structure for the workbook
‘read variable values – FormIndex=2, etc.
End Sub


You will now be able to reference this variable from within your UserForm.
GeneralRe: Referencing Variables in Module1 Pin
Win32SF12-Sep-10 11:45
Win32SF12-Sep-10 11:45 
GeneralRe: Referencing Variables in Module1 Pin
ChandraRam12-Sep-10 11:48
ChandraRam12-Sep-10 11:48 
GeneralRe: Referencing Variables in Module1 Pin
Win32SF12-Sep-10 12:54
Win32SF12-Sep-10 12:54 
QuestionPaging in Datagridview Pin
C#Coudou9-Sep-10 15:27
C#Coudou9-Sep-10 15:27 
QuestionPop Out Side Menu (Visual Studio Style) Pin
eddieangel9-Sep-10 12:26
eddieangel9-Sep-10 12:26 
AnswerRe: Pop Out Side Menu (Visual Studio Style) Pin
tosch10-Sep-10 1:07
tosch10-Sep-10 1:07 
AnswerRe: Pop Out Side Menu (Visual Studio Style) Pin
Thomas Stockwell12-Sep-10 8:36
professionalThomas Stockwell12-Sep-10 8:36 
AnswerRe: Pop Out Side Menu (Visual Studio Style) Pin
darkelv13-Sep-10 19:46
darkelv13-Sep-10 19:46 
QuestionWhy are there no form control arrays in vb.net? Pin
MikeD 29-Sep-10 1:26
MikeD 29-Sep-10 1:26 
AnswerRe: Why are there no form control arrays in vb.net? Pin
Dave Kreskowiak9-Sep-10 3:43
mveDave Kreskowiak9-Sep-10 3:43 
GeneralRe: Why are there no form control arrays in vb.net? Pin
MikeD 29-Sep-10 6:49
MikeD 29-Sep-10 6:49 
AnswerRe: Why are there no form control arrays in vb.net? Pin
Luc Pattyn9-Sep-10 4:47
sitebuilderLuc Pattyn9-Sep-10 4:47 
GeneralRe: Why are there no form control arrays in vb.net? Pin
MikeD 29-Sep-10 6:46
MikeD 29-Sep-10 6:46 
AnswerRe: Why are there no form control arrays in vb.net? Pin
Ian Shlasko9-Sep-10 10:59
Ian Shlasko9-Sep-10 10:59 
QuestionAbout Search File List Pin
josephkumar8-Sep-10 23:14
josephkumar8-Sep-10 23:14 
AnswerRe: About Search File List Pin
Richard MacCutchan8-Sep-10 23:22
mveRichard MacCutchan8-Sep-10 23:22 
Questionhow to use Compare? Pin
zhiyuan168-Sep-10 20:20
zhiyuan168-Sep-10 20:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.