Click here to Skip to main content
15,912,977 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: How the Windows password at run-time get؟ Pin
Shameel17-Nov-09 3:50
professionalShameel17-Nov-09 3:50 
AnswerRe: How the Windows password at run-time get؟ Pin
Dave Kreskowiak17-Nov-09 4:09
mveDave Kreskowiak17-Nov-09 4:09 
AnswerRe: How the Windows password at run-time get؟ Pin
The Man from U.N.C.L.E.17-Nov-09 6:30
The Man from U.N.C.L.E.17-Nov-09 6:30 
GeneralRe: How the Windows password at run-time get؟ Pin
Milad.Biroonvand17-Nov-09 18:02
Milad.Biroonvand17-Nov-09 18:02 
AnswerRe: How the Windows password at run-time get؟ Pin
Shameel17-Nov-09 22:17
professionalShameel17-Nov-09 22:17 
GeneralRe: How the Windows password at run-time get؟ Pin
Milad.Biroonvand17-Nov-09 23:47
Milad.Biroonvand17-Nov-09 23:47 
QuestionExcel VBA Pin
veon cheng16-Nov-09 22:33
veon cheng16-Nov-09 22:33 
QuestionDynamic Form Combo Box issue [modified] Pin
Blake Dickson16-Nov-09 16:53
Blake Dickson16-Nov-09 16:53 
Hi,

Im relatively new to this! So hello to everyone here Smile | :) .

I have been writing this code to allow combo boxes to dynamically create other combo boxes within the form, and then those ones to create comboboxes from themselves also. If this is a bit confusing here is the code I have been working on

Private Sub ComboBox1_Change()

    Set optionComboBox = Me.controls.Add("Forms.ComboBox.1", newComboname)
    With optionComboBox
        .Text = "Please Select an option..."
        .left = 100
        .width = 290
        .top = 125
    While Not (IsEmpty(Range("'Info'!a" & Counter)))
            Y = Range("'Info'!a" & Counter).Value
                If InStr(1, Y, "DM|") > 0 Then
                    If InStr(1, Y, "DM|SH|") = 1 Then
                        Else
                        optionComboBox.AddItem (Range("'Info'!b" & Counter).Value)
                    End If
                End If
        Counter = Counter + 1
        optionComboBox.SetFocus
    Wend
    End With


And the problem I am having is that I cannot reference something in VB that has not yet been created.

E.g. I wish to do something like this

Private Sub newComboname_Change()

While Not optionComboBox.Text = "Please Select an option..."
    
    Set optionComboBox = Me.controls.Add("Forms.ComboBox.1", "ComboBox" & ComboboxNumber)
    With optionComboBox
        .left = 100
        .width = 290
        .top = 165
    While Not (IsEmpty(Range("'Info'!a" & Counter)))
            Y = Range("'Info'!a" & Counter).Value
                If InStr(1, Y, "DM|") > 0 Then
                    If InStr(1, Y, "DM|SH|") = 1 Then
                        Else
                        optionComboBox.AddItem (Range("'Info'!b" & Counter).Value)
                    End If
                End If
        Counter = Counter + 1
        optionComboBox.SetFocus
    Wend
    End With
    
    Wend
End Sub


newComboname being the new combo box that was created on the Combobox1_change event.

Is there a way to reference this in a Sub? Or any other way will do really!

Any help would be appreciated!!

modified on Monday, November 16, 2009 11:22 PM

AnswerRe: Dynamic Form Combo Box issue Pin
Christian Graus16-Nov-09 18:08
protectorChristian Graus16-Nov-09 18:08 
GeneralRe: Dynamic Form Combo Box issue Pin
Blake Dickson16-Nov-09 18:16
Blake Dickson16-Nov-09 18:16 
GeneralRe: Dynamic Form Combo Box issue Pin
Christian Graus16-Nov-09 18:56
protectorChristian Graus16-Nov-09 18:56 
GeneralRe: Dynamic Form Combo Box issue Pin
Dave Kreskowiak17-Nov-09 1:17
mveDave Kreskowiak17-Nov-09 1:17 
GeneralRe: Dynamic Form Combo Box issue Pin
Blake Dickson17-Nov-09 11:18
Blake Dickson17-Nov-09 11:18 
GeneralRe: Dynamic Form Combo Box issue Pin
Dave Kreskowiak17-Nov-09 15:34
mveDave Kreskowiak17-Nov-09 15:34 
QuestionSorting crystal report char on month name Pin
Salman Sheikh16-Nov-09 13:33
Salman Sheikh16-Nov-09 13:33 
AnswerRe: Sorting crystal report char on month name Pin
Mycroft Holmes16-Nov-09 13:44
professionalMycroft Holmes16-Nov-09 13:44 
GeneralRe: Sorting crystal report char on month name Pin
Salman Sheikh18-Nov-09 11:04
Salman Sheikh18-Nov-09 11:04 
QuestionChecking for the end of an arry Pin
a_b_clark16-Nov-09 3:40
a_b_clark16-Nov-09 3:40 
AnswerRe: Checking for the end of an arry Pin
EliottA16-Nov-09 4:11
EliottA16-Nov-09 4:11 
GeneralRe: Checking for the end of an arry Pin
Shameel16-Nov-09 5:11
professionalShameel16-Nov-09 5:11 
AnswerRe: Checking for the end of an arry Pin
Luc Pattyn16-Nov-09 5:38
sitebuilderLuc Pattyn16-Nov-09 5:38 
Questionget google service in Visual Basic. Pin
shailendra_csp16-Nov-09 2:11
shailendra_csp16-Nov-09 2:11 
AnswerRe: get google service in Visual Basic. Pin
EliottA16-Nov-09 2:19
EliottA16-Nov-09 2:19 
GeneralRe: get google service in Visual Basic. Pin
Eddy Vluggen16-Nov-09 4:09
professionalEddy Vluggen16-Nov-09 4:09 
GeneralRe: get google service in Visual Basic. Pin
Dave Kreskowiak16-Nov-09 5:39
mveDave Kreskowiak16-Nov-09 5:39 

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.