Solved

Vb files

Posted on 1999-01-02
6
134 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
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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

773 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