?
Solved

Vb files

Posted on 1999-01-02
6
Medium Priority
?
138 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 40 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
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…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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