Solved

Vb files

Posted on 1999-01-02
6
137 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
[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
6 Comments
 

Author Comment

by:amird
ID: 1453620
thanks...
0
 
LVL 1

Expert Comment

by:agrillage
ID: 1453621
I would suggest increasing the points for this.
0
 
LVL 1

Expert Comment

by:agrillage
ID: 1453622
I would suggest increasing the points for this.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Expert Comment

by:bruintje
ID: 1453623
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
ID: 1453624
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
ID: 1453625
thanks!!!
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

729 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