Solved

Vb files

Posted on 1999-01-02
6
133 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 57
Copy a row 12 58
How to measure sizes and angles in scanned images ? 3 54
Passing a Text Box name to a Sub 6 76
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

895 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

11 Experts available now in Live!

Get 1:1 Help Now