Click here to Skip to main content
15,919,132 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Thanks for prior help- next problem- array/collection or class to store/save data Pin
Andy_L_J28-May-10 8:41
Andy_L_J28-May-10 8:41 
GeneralRe: Thanks for prior help- next problem- array/collection or class to store/save data Pin
lemarshall2-Jun-10 16:36
lemarshall2-Jun-10 16:36 
QuestionCreating label array in vb.net 2007 Pin
lemarshall27-May-10 5:24
lemarshall27-May-10 5:24 
AnswerRe: Creating label array in vb.net 2007 Pin
Luc Pattyn27-May-10 5:39
sitebuilderLuc Pattyn27-May-10 5:39 
GeneralRe: Creating label array in vb.net 2007 Pin
lemarshall27-May-10 6:37
lemarshall27-May-10 6:37 
GeneralRe: Creating label array in vb.net 2007 Pin
Luc Pattyn27-May-10 7:46
sitebuilderLuc Pattyn27-May-10 7:46 
AnswerRe: Creating label array in vb.net 2007 [modified] Pin
William Winner27-May-10 8:21
William Winner27-May-10 8:21 
GeneralRe: Creating label array in vb.net 2007 Pin
lemarshall27-May-10 9:50
lemarshall27-May-10 9:50 
Thanks, the last two replies help me to understand what is going on a little bit better. I'm wanting an easier way to handle this. I have a tab on the form with 4 tabs and on each tab the number of items that will vary from day to day : 13 Rods, 11 Tubes, 10 Equip, and 9 Misc. So hard coding it is not really desirable.

I wonder if it shows Null or nothing as a result of the labels being on the tab. When I ran this:
For Each Row In dstbl.Rows
    If rowNdx = recCount Then
        Exit For
    End If
    For Each c As Control In Me.TabPage1.Controls
        If c.Name = "lblRods_" & lblNdx Then
            c.Tag = dsMaterial.Tables(0).Rows(rowNdx)("MaterialsID").ToString()
            c.Text = dsMaterial.Tables(0).Rows(rowNdx)("Material").ToString()
        End If
    Next
    rowNdx = rowNdx + 1 'keep track of where we are at
    lblNdx = lblNdx + 1
Next


It did not work as For Each c As Control In Me.Controls Debug.Print showed me the names of each control but I just got tabLOL but not tabLOL.TabPage1 so when I hard coded it fills in properly.

So I changed to having 4 separate functions:
Private Function LoadTab1Data() As Boolean
Private Function LoadTab2Data() As Boolean
Private Function LoadTab3Data() As Boolean
Private Function LoadTab4Data() As Boolean

And it seems to be working when I change the statement:
Dim mySelectQuery As String = "SELECT MaterialsID, Type, Sequence, Material " & _
    "FROM Materials " & _
    "WHERE Type = 2 " & _
    "ORDER BY Type, Sequence;"

and change the Type.

Would still like to modularize it more and make it one Function that goes through the data 4 times and fills in each tab page properly.

Works clumsily now, but still hoping to refine it,

Larry
GeneralRe: Creating label array in vb.net 2007 Pin
William Winner27-May-10 10:42
William Winner27-May-10 10:42 
Questionvisual basic 2008 captcha to picture box help Pin
Snipe7627-May-10 2:43
Snipe7627-May-10 2:43 
AnswerRe: visual basic 2008 captcha to picture box help Pin
Henry Minute27-May-10 4:37
Henry Minute27-May-10 4:37 
Question[Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 2:06
fenindom27-May-10 2:06 
AnswerRe: [Need Correction]Class To Load sqlReader into Listview Pin
Tom Deketelaere27-May-10 2:34
professionalTom Deketelaere27-May-10 2:34 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 3:04
fenindom27-May-10 3:04 
AnswerRe: [Need Correction]Class To Load sqlReader into Listview Pin
William Winner27-May-10 8:30
William Winner27-May-10 8:30 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 9:19
fenindom27-May-10 9:19 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
William Winner27-May-10 9:23
William Winner27-May-10 9:23 
GeneralRe: [Need Correction]Class To Load sqlReader into Listview Pin
fenindom27-May-10 9:27
fenindom27-May-10 9:27 
QuestionProcedure and code for adding a plug-in for Outlook. Pin
S.Srinivasa Rao26-May-10 23:18
S.Srinivasa Rao26-May-10 23:18 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Dalek Dave26-May-10 23:52
professionalDalek Dave26-May-10 23:52 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Tom Deketelaere27-May-10 2:37
professionalTom Deketelaere27-May-10 2:37 
AnswerRe: Procedure and code for adding a plug-in for Outlook. Pin
Eddy Vluggen28-May-10 1:56
professionalEddy Vluggen28-May-10 1:56 
GeneralRe: Procedure and code for adding a plug-in for Outlook. Pin
Luc Pattyn28-May-10 2:38
sitebuilderLuc Pattyn28-May-10 2:38 
GeneralRe: Procedure and code for adding a plug-in for Outlook. Pin
Eddy Vluggen28-May-10 5:08
professionalEddy Vluggen28-May-10 5:08 
QuestionWindows Service Comsuming 99% CPU Pin
VikashGohil26-May-10 21:11
VikashGohil26-May-10 21:11 

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.