?
Solved

getting combo1 from a file

Posted on 2000-05-09
3
Medium Priority
?
231 Views
Last Modified: 2011-04-14
Hi,
I have a form, called word.frm i have on that form a combo1
and i created a text1. and a command button.

I save to a file named "favo.dat"
with:
(favo.dat exists already and has www.markvt.org in it.)

open "favo.dat" for append as #1
print #1,text1.text
close #1

now my problem:

In favo.dat are the favorite pages of my browser.
i want to open favo.dat and add every rule to combo1

how do i do that ?

points are for the good answer, help me and you get the points.
{The person with the first good answer get the points [!!!]}

mark@markvt.tmfweb.nl



0
Comment
Question by:markyvt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2794301
This subroutine should do it:

Sub LoadComboBox ()
Dim S as String
Dim Chnl as Integer

Chnl = FreeFile
Open "Favo.dat" for input as #(Chnl)
Do While Not EOF(Chnl)
  Line Input #(Chnl), S
  If S <> "" Then
    Combo1.AddItem S
  End If
Loop
Close #(Chnl)
End Sub
0
 
LVL 4

Accepted Solution

by:
dreamvb earned 60 total points
ID: 2794320
Hello this will work for you

Private Sub Combo1_Click()
 Shell "start.exe " & Combo1.Text, 1
 
End Sub

Private Sub Form_Load()
Dim Filenum As Integer
Dim StrBuffer As String
Filenum = FreeFile
 Combo1.Clear
Open "C:\favo.dat" For Input As #1
 Do While Not EOF(Filenum)
 Input #Filenum, StrBuffer
 Combo1.AddItem StrBuffer
 Loop
 Close #Filenum
 
End Sub
0
 
LVL 4

Expert Comment

by:dreamvb
ID: 2797971
Thanks for the points and hope your program goes well
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question