Solved

getting combo1 from a file

Posted on 2000-05-09
3
204 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 189
using Access 8 68
Error when passing an argument to a vb6 that contains  '/' 7 37
Automatic Email Reminder 4 37
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

770 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