Solved

getting combo1 from a file

Posted on 2000-05-09
3
194 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
  • 2
3 Comments
 
LVL 32

Expert Comment

by:bhess1
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 15 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now