Solved

Vb files

Posted on 1999-01-02
6
132 Views
Last Modified: 2010-05-03
please write the function that recieves a line from a list box (based on a text file)  , does changes in it (Edit) and returns the new line to the exact spot of the text file
0
Comment
Question by:amird
6 Comments
 

Author Comment

by:amird
Comment Utility
thanks...
0
 
LVL 1

Expert Comment

by:agrillage
Comment Utility
I would suggest increasing the points for this.
0
 
LVL 1

Expert Comment

by:agrillage
Comment Utility
I would suggest increasing the points for this.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 44

Expert Comment

by:bruintje
Comment Utility
Hi,

Correct me if I'm wrong, but you mean

Copying a line of text from a listbox to an editbox or something
Edit the line
And then return it to its place in the listbox

If you say yes to these three Q's I'll be on it!

Happy new year.
:O) bruintje
0
 

Accepted Solution

by:
edunc earned 10 total points
Comment Utility
this is perfect for what you're doing!  i wish the points were higher though. :o(

make a listbox (list1), a textbox (text1), and a command button(command1).

then put the following code in:

Private Sub form_load()
  Open "yourfile" For Input As #1
  Do Until EOF(1)
    Input #1, x
    List1.AddItem x
  Loop
  Close
  Command1.Caption = "&Edit"
End Sub

Private Sub command1_click()          'edit button
  If Command1.Caption = "&Edit" Then
    Command1.Caption = "&Done"
    Text1.Enabled = True
    Text1.BackColor = &HFFFFFF
    Static n As Integer
    n = List1.ListIndex
    Text1.Text = List1.List(List1.ListIndex)
    Text1.SetFocus
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)
  Else
    Command1.Caption = "&Edit"
    Text1.BackColor = &HC0C0C0
    Text1.Enabled = False
    List1.List(n) = Text1.Text
    Text1.Text = ""
    Open "yourfile" For Output As #1
    For i = 1 To List1.ListCount
      Print #1, List1.List(i)
    Next i
    Close
  End If
End Sub

0
 

Author Comment

by:amird
Comment Utility
thanks!!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

744 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

15 Experts available now in Live!

Get 1:1 Help Now