SolveErrors
Visual Basic

Re: Help Please - Insert from txt >> Module or something

15 views

I have an application that when its run it calls for a file and the contents of that file is loaded into the combo box.

Question: How can I remove the txt file altogether so I dont have to have the txt file as part of my installation and now part of the main application instead?

Here is the code part I use for calling the txt file

Code:
cboSite.Clear
    Dim intFree, x As Integer
    x = 1
    intFree = FreeFile
    Open App.Path & "\tdx.txt" For Input As #intFree
        Do Until EOF(intFree)
            Input #intFree, mstrName(x), mstrSite(x), mstrAdd(x)
            x = x + 1
        Loop
    Close
    For x = 1 To UBound(mstrName)
        If mstrName(x) <> "" Then
            cboSite.AddItem (Format(x, "00") & " - " & mstrName(x))
        End If
    Next x
    
    cboSite.ListIndex = 0
I wanted to know if I could just create a blah.bas file and place the contents of the txt file into the blah/bas file and call that file when the application loads loading the content into the combo box?

Thank you , This is way over my head and I am unsure of what direction I am going in, so confused.

I copied code here and there and pressed the button and this spat out:

Code:
ArrPM = Array("+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+","+")
That was in the debug window. Im confused on what I need to do and didnt realise it was this hard. Sorry.

More Visual Basic fixes

cannot update database (dataset is updating)how to Add asp.net web pages (vb.net code behind) to sharepoint siteCannot unload a Form Using Proper CodeWORD -> DATE, WORD -> TIME (C->VB)Re: On screen Keyboardhow to add node to treeview at runtime in vb6.0 ?