Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Need A Code That Alowes Entries In Text Boxes To Be Saved


Hi,

I am very new to VB..
I'm hoping some of you might be able to help me make a code to apply in text boxes made in MS Word 2000..

I have made a document with several text boxes, and saved it as a web page.
When I open the document in IE, I can add text in the boxes, and print it out.

What I would like is to be able to save the webpage with the entered text still in the boxes...
When I save now, and reopen, the boxes are empty..

Any hints?


Brgds André




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Add Text Boxes To UserForm Through Code
Hi, everyone...is it possible to add a textbox to a userform through code? I'd like to add 1 textbox for each sheet in my activeworkbook...

Any ideas?

Thanks,

Dave M....

P.S. I've tried using something like the following:


Code:
Private Sub UserForm_Activate()
Dim mySht As Variant

For Each mySht In ActiveWorkbook.Sheet
UserForm1.OLEObjects.Add(ClassType:="Forms.TextBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=578, Top:=87, Width:=117, Height:=34). _
Select
Next

End Sub

but I get a "Method or data member not found" with the .OLEObjects highlighted...

Clearing Text Boxes In Code!
I have an option control that a user answers a yes/no question with. There is a frame below this question with text boxes that the user fills in if the answer to the previous question is no. Also after entering this information and saving it to the database the user can search for a record and dislplay the information in the same text boxes. Any way what I am having trouble doing is when the user clicks No I have a message box pop up and tell them that if they click yes on this message box that all the information inside the frame below will be erased and do they wish to continue. If they do click yes I use two for loops to clear all the information in the frame like this:
txtViolations(x) = ""

My problem is that after erasing all this information when the user presses Save to save the changes they have made it is supposed to save all the information as cleared, but it does not save the changes I have made by clearing the text boxes. My guess is that when you clear something in code it does not show up as changed when you go to update the recordset. If so how do I make it think it has been change, and if not what do I do?

2 Text Boxes 2 Different Forms Same Code
Alright, there are 2 forms, one with one text box, then 1 with another. I need to have it so both txt boxes will work in teh same code. for instance...this code wont work since its on 2 diff forms...

If Not (rs.BOF = True Or rs.EOF = True) Then
txt1.Text = rs.Fields("UPC")
txt2.Text = rs.Fields("Serial")

since it cant read the variable on txt2 since its on form2 so how do i make this?

Help With Code To Fill Text Boxes
Hi,

I have an address database with the Field ID as the primary key, I have managed to load by code a combo with surnames.

What I want to do is load textboxes, such as address and suburb from the DB which correspond to the name when selected in the combo.

Any sample of code to do this is appreciated.

Regards,

Alan.

Looping Thru Entries In Looped Set Of Combo Boxes
How about a loop within a loop ?

I load a form with 5 combo boxes that are indexed
cboDur(0)
cboDur(1)
cboDur(2)
cboDur(3)
cboDur(4)

I fill each combo box with the same data.

I then read a database that contains a field for each of these combo boxes.
ie. for cboDur(0) the data might be the first record in the list
ie. for cboDur(1) the data might be the Tenth record in the list
ie. for cboDur(2) the data might be the Third record in the list
etc

I want to set the appropriate record as selected for each of the combo boxes.

' dDur$ is the value taken from database

I am trying to use this code...

' Loop thru each combo box
For i% = 0 to 4
' Loop thru each item in the current combo box
For j% = 0 To CboDur(i%).ListCount - 1
If CboDur(i%).Text = dDur$ Then CboDur(i%).ListIndex =
CboDur(i%).NewIndex
Next
Next

I am having trouble with the "If" statement
I've tried the following:
If CboDur(i%).Text(j%) = dDur$
If CboDur(i%).(j%).Text = dDur$
If CboDur(j%).Text = dDur$
If CboDur(i% , j%).Text = dDur$

Can someone provide a sample ?
Thanks
BB

Taking Duplicate Entries From Combo Boxes.
Hey, i'm new to vbCity so hello everybody! I am not exactly what you would call a skilled VBer! In fact i'm totally rubbish at it! I am writing a program that adds addresses to a text file and then can recall the data back when it is searched for, i.e if a phone number is recognised, all the data for that number is recalled. All the street names enclosed in the entire file are added to a combo box. My problem is that by use of as simple code as possible, i want it so that there cannot be two duplicate roads, i.e. if the file has two records for the same street then i only want the street to be displayed once!

Your quick correspondance is appreciated, and i thank you in advance
Mike Smith

How To Give Common Code For All The Text Boxes
hi! I am new to vb6
I have 10 text boxes in my form(form1).
For each text box, If the user presses enter then it must go to the next text box. I dont want to write OnKeypress function for each text box. Is there any solution or only an single set of function which will work for all the text boxes. i.e if the user presses enter in any text box then it must goto the next text box. PLZ HELP

i also the same problem with GotFocus( I have to change the backcolor of the textbox to yellow when gotfocus)

Locking And Unlocking Text Boxes With Code
I have a few textboxes that I need to set locked and greyed out and I need to also be able to change that with a command button. So what I need is for the user to see the information but not be able to change it. when the add button is clicked the user needs to be able to enter the information. Then when the update button is clicked it needs to lock the information back and grey it out. Is this possible to do. I am not sure how to code this. If anyone could show me how to do this with code it would be very helpful.

Let me thank you in advance for any help.

Problems Displaying Data In Text Boxes Using Ado Code
I am using the shape command to get all the data I need to display on my form and at the moment i am using a 2datagrids to display it. What I want to do is have 5 textboxes each displaying different bits of the data ie order,date,etc etc. the code I am using on my form is:

Code:
Private Sub Form_Load()
Dim vReturnValue As Variant
vReturnValue = InitialDataCtlCaptions()
Dim db As ADODB.Connection
Dim adoPrimaryRS As New ADODB.Recordset
Dim Expr1 As ADODB.Recordset


Set db = New ADODB.Connection

db.CursorLocation = adUseClient

db.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "Colour.mdb" & ";Persist Security Info=False"


adoPrimaryRS.Open "SHAPE {SELECT `Jkt Schedule 1`.`Mill Order No`, _
`Jkt Schedule 1`.`Design Desc`, `Jkt Schedule 1`.`Design No`, `work in progress`. _
`Mill Order No` AS Expr1, `work in progress`.`Cols Made` FROM `work in progress`, _
`Jkt Schedule 1` WHERE `work in progress`.`Mill Order No` = `Jkt Schedule 1`.`Mill Order No`} _
AS Command1 APPEND ({SELECT `cloth qty booked`.`order`, `cloth qty booked`.`Cloth Qty Booked`, _
`Batch Footer`.`Batch no`, `Batch Footer`.`Roll Id`, `cloth qty booked`.`Roll Id` AS Expr1 _
FROM `Batch Footer`, `cloth qty booked` WHERE `Batch Footer`.`Roll Id` = `cloth qty booked`.`Roll Id`} AS Command2 _
RELATE 'Mill Order No' TO 'order') AS Command2", db, adOpenStatic, adLockOptimistic

Set DataGrid1.DataSource = adoPrimaryRS

Set DataGrid2.DataSource = adoPrimaryRS("Command2").UnderlyingValue

End Sub
Any one know how I can display the data in some nice textboxes?

Thanks

Spacing Out Between Saved Text...
How can I add a space between lines in a text file when user is saving it?

My code:

cboHome.Text & " to "; txtVisitors.Text & ". "; txtScore.Text; " score."

So once user enters text into those it saves into a file but in 1 line. How can I make it so there is space between each line?

Why Text File Not Saved Occassionally
Hello. I use a richtextbox to document our services to our clients. The textbox is saved in textfile. It does not save may be once in a few hundred times that I hit Save. Usually I hit Save and exit, believing that the document is saved. When return to that document, the textbox is blank sometimes, or sometimes only a newly added portion of the document is not there. Keep in mind, this happens only once in a few hundred times of saving the file, or once or twice a year. Does that have to do with memory for some reason? or what? I don't see anything wrong with the code. Below is my code for loading and saving. Please review and give me any advice. Thank you.

VB6:


Code:
Private Sub ShowText()
'This line is needed to load a textfile name and save the file.
Get MainFileNumber, CurrentRecordPosition, mRecord
LblChildName2.Caption = Trim(mRecord.FirstName) + " " + UCase(Trim(mRecord.LastName))
LblParents2.Caption = Trim(mRecord.Parents)
LblClass2.Caption = Trim(mRecord.Class) + " -- " + Trim(mRecord.Teacher)
LblPhone2.Caption = Trim(mRecord.Phone)

' FSLogFileName is declared as string in Module
FSLogFileName = WorkingFilePath & "" & Trim(mRecord.RecordID) & "-Servicelog.txt"

Dim FindFilename As String
FindFilename = Dir$(FSLogFileName)
If FindFilename = "" Then
' Createfile if file does not exist
RichTextBox1.Text = ""
file
' RichTextBox1.LoadFile FSLogFileName
Else ' If filename was found, read record
RichTextBox1.LoadFile FSLogFileName ' Format to load Richtext file
End If

' Brings cursor to the end of text
If Len(Trim(RichTextBox1.Text)) > 300 Then
RichTextBox1.SelStart = Len(Trim(RichTextBox1.Text))
End If

End Sub

Private Sub Save()

FSLogFileName = WorkingFilePath & "" & Trim(mRecord.RecordID) & "-Servicelog.txt"
RichTextBox1.SaveFile FSLogFileName, rtfRTF ' Save file

End Sub

Bold Text Moves To Saved Txt?
ok guys see if you can figer this one out
i save a file to whatever.doc but its not saveing the formatting to the new file the bold text impaticaler
i use a true text box and i select text and hit a butten to bold the text selected.
this code runs

Code:
Private Sub cmdhighlight_Click()
rtbMdcDisplay.SelBold = True
End Sub
that makes the text bold then i save it to a .doc file


Code:
Private Sub Command1_Click()
On Error GoTo hell
Open Dir1.Path & "" & Text1.Text & ".doc" For Output As #1
Print #1, FrmTxtWindow.RtbFileVeiw.Text
Close #1
valuelabel.Caption = Dir1.Path & "" & Text1.Text & ".doc"
FrmTxtWindow.Enabled = True
frmSaveAs.Hide
Exit Sub
hell:
MsgBox Err.Description, vbCritical, Err.Number
End Sub
but then i open the doc file in word and all the formatting is gone only thing right is each line is on the right line.

so this text
this is a test normal
this is a test bold

comes up in word as
this is a test normal
this is a test bold

i hope you understand what i mean.. please help

thanks in advance

How Can I Use A Specified Information Saved In A Text File?
I have a program that uses this code to write the info entered by the user in a text file:


Quote:




Private Sub Command1_Click()
n = Text1.Text
a = Text2.Text

Open "h:RECORDS.txt" For Append As #7
Write #7, n, a
Close #7

MsgBox "Done!"

End Sub






I am using this code to put the first field (na) of info of the text file in a combobox:


Quote:




Private Sub Command2_Click()
Open "h:RECORDS.txt" For Input As #3
Do While Not EOF(3)
Input #3, na, ag
Combo1.AddItem na
Loop

Close #3






How can I make my program so it only goes to the next form (ex. form2) when the second field of info (ag) in the text file is entered in the second textbox (a)?

Saved Text File Not Centered
I have a rich text box that has centered text in it, and I save it, but when I open it up and put it back in the text box it is not centered, and when I print the text it is not centered. What is wrong?

Using Wordpad With VB Saved Text Files
I have a program in which I save TXT files using Write (VB 3.0). I then have users connect to Wordpad to avoid a lot of printer issues via a selection in my program which auto opens the file.

My problem is twofold. Wordpad doesn't save page attributes for formatting such as margins or orientation.

Second, I need to insert a Page Break character in my file with the Write command at certain points. How do I do this, and how will wordpad handle them?

Any ideas. Many thanks....

Loading Saved Text From Resource
here's the deal, i have loaded icons and text into a resource file... i can get at the icons alright but i have no idea how to load the strings from it.

the string index is 101, if this helps. its to load it into a text box.

Any relitive answer is welcome
thnx

Want To Convert Text In Text Boxes To Normal (without Text Boxes)
Hi all,

Our Client is sending files in RTF Document format which has some content. Each and every word in that document is in its own text boxes (i.e., the RTF has full of text; each and every word is in own text box). I need to convert it to normal word document without text boxes. But my problem is the entire content of that file is coming in text boxes. so it is very difficult to convert it to normal word document (without text boxes).

Currently I have two choices to do that: one is select the text box and copy the content and paste it in a new file. but all formatting is lost. i have to do all formatting manually. The second option is convert it to PDF and do a conversion and check alignments give some missing formatting etc.

These cases are ok if I got a file with full of text paragraphs. but most of the time I am getting tables. That time these ways are not smart way to do that.

Is there any other way to convert that file to normal word document. Pls let me know.

Currently I used to convert that document to Adobe PDF and will do a PDF conversion and then I will do a formatting as per the RTF document.

So, it is taking to much of time consuming and effort.

Is there any solution for this?

Thanks!

CS.

Code For Finding Database Entries.
On the surface this seems like a relatively simple VBA code problem, but I cannot get my head round the concept of the 'Find' property and dealing with code that will define data entry based on two fields!

Any help on any of the points I have outlined below would be absolutely fantastic and enable to me to virtually complete the database I am currently trying to build. I would like to thank anyone in advance for providing any input into the problem I have outlined below:

I have managed to write a 'Do While' loop which updates a combobox selection from an open (variable) vertical data array. The array contains dates (mm-yy) in chronological order, and must correspond to another combobox selection containing 'project names' (chosen by the user) with an equivalent loop structure. Now I need to write some code which will:

1. Acknowledge that a selection from the list has been made (by the user) in a combobox.

2. Check to see whether this entry has been made before in the database which must also depend on an item selected from the other combobox (possibly using the 'Find' property?!!).

3. If the entry has not been made before, it must choose where to make the entry (i.e. by finding the correct row down in chronological order. e.g. if an entry for a date has previously been made say for April 2002 for a specific project name, then the code will need to search for this entry and insert a row and the corresponding entries of data below it if say you were entering data for May 2002 for that project).

As I said if anyone has a clue about producing code to solve any one of these ideas I would be most grateful.

Regards,

Bruce

Reading Uncode Saved Text File
i have a text file saved in unicode format (i needed to use 3 different langs there). how do i read the file and display text.

i guess i'd need to show it in RichTextBox, but if i just use Line Input and do RichTextBox.text= , then it just shows me like if i'd open it in notepad...

so, what do i need to do

TIA!

Changing The Saved Info In A Text File
Let's say for example, some info's been saved using this code:

Open "C:Textfile.txt" For Append As #3
Write #3, Text1, Text2, Combo1.text, List1.text
Close #3

and the text file is something like:

Code:
"James", "16", "Green", "1990"
"Bob", "20", "Red", "1980"

How can change an specific info in the text file? (For example, the user enters "Bob" as his name in my program and changes "Red" to something else in a combobox. So i need the computer to find "Bob" in the text file and change "Red" to something the user enters in my program.)

If any more info is required, tell me and i will add.

Asap & thnk you

Multiple TextBox's Saved To Text File
Hi, Please help.
I am creating a form in VB6 that has three textbox's and a "save" commandBox.

I would like the save box to take the information in the three textbox's and place them in a text file (c: est.text [for discusion purposes]), then clear the fields ready for the next information. Then when save is clicked again it "adds" the information to the text already in the test.txt file.

Thanks in advance for any help that may be offered.

VB Code For Highliting Recent Entries In A Table
I'm trying to write code that highlites recent entries into a table.
I have created a form that contains a command button that brings up the proper table but I want to be able to bring the table up and highlite the data that has just been entered.

Thanks
Merck

All Things In Form Text Boxes List Boxes...Saving
Is the a command thats save every thing that is changed changed in form ...all text boxes all list boxes ...everything that has changed

Checkbox State Saved To Sequential Text File
I need to save the state of some checkboxes to a sequential textfile. I am getting a type mismatch when I read the state back out of the file as a string(true or false) and try to assign it to the checkbox on my form. What type of Variable should I be using?

Here is what I'm trying.....

To get the state from the form:

dim FL as string

if checkFL.value then
FL$="true"
else: FL$="false"
end if


Once ive read the file and retreived it as a string, to assign it back to the checkbox:

checkFL.value = FL$

- this statement gives me a type mismatch when run. How should this be done?

Much Thanks for the help......Larry

Contents Of Datacombo Box Not Saved While All Others Are Saved!
Hi,

I have a form that has text boxes,datacombo's and date picker controls.when i try to save anew record,the contents of the datacombo boxes are not saved here's the code i use

Code:
 With Adoproject.Recordset
             .AddNew
             !PROJCODE = Text1
             !CLIENTname = DataCombo1
             !contact = Text4
             !PROJTITLE = Text2
             !PROJSTAT = List1
             !StartDate = DTPicker1
             !EndDate = DTPicker2
             !budgetedexp = Text9
             !Leader = DataCombo2
             !budgetedhrs = Text11
             .Update
        End With
         

Text Entries
This is what i have so far

Code:
Open "edittext.txt" For Output As #1
Open "originaltext.txt" For Input As #2

x = 1
Do While Not EOF(1)
Input #2, UserName, UserID
If Not NewUser.User.Selected(nIndex) = UserName Then
Write #1, UserName, UserID
End If
x = x + 1
Loop
Close #1
Close #2
It doesn't write anything to text.txt , can anyone tell me what is going on??

Also, how do i rename edittext.txt to originaltext.txt. I think i have to kill originaltext.txt first.

Text Box Entries
I have put several Text Box's on a Form and assigned this as Text in the Text Box's property sheet "[- Available -]". When I try to Type something in th TextBox it won't do it nothing Happens. Do I have to erase what's in the Box and Then Type or What?

Can You Have Multiple Colours In Text Boxes, Or Richtext Boxes(etc)?
Is there anyway you can have each word in a text box a different colour? Like:

[RED] My Name [/RED]
[BLUE] What's up! [/BLUE]

or something similar?

I don't care if you can't do it in a text box but is there anyway to do it in any type of "text box"?

If sub classing is involved could you please point me to a tutorial?


Thanks a lot.

Web Control, List Boxes, Text Boxes, Please Help This Is Winding Me Up!
Hi guys i need some help with the webcontrol function in VB6

Part of my program needs to put listbox data from the program into a text box on the web and then click a submit button...

The list box i have has a list of multiple directories in (for the location of my files), from there i just want the program to put the top directory of the list box into a text box on the web and click a submit button on the web (its for uploading a queue of files), then after that has finished uploading, do the next directory in the list box... etc

It sounds pretty simple but i have no idea how to do it...

Thanks for any help you can give me, i will write a really good review about you and good rating etc.

Any knowledge of this would be greatly appreciated

thanks a bunch

toodle pipples

Alex

Saving Text Box Entries
Is there a way to save the entry in a text box so that the next time the user form is entered the text that was entered the last time appears in the text box?

For example, when my VBA user form pops up I ask for the company name and their website which they enter into a text box. Is there a way for that information to be there when they open the word document in the future?

Thanks.

Mike

Multiple Entries In 1 Text Box
I need help doing something with a text box. Heres the situation... I have a command that brings a text box visible to the form. I then want the user to input say "5" into the text box... and then hit a command that says add which takes that number to a label called total... then if the user has another number to put into the text box, the first one entry deletes after the add command is pushed and the user can put another entry in the same text box. Say the number is "4", then the add command is pushed again deleting the "4" and adding it to the 5 previously in the label. Can somebody help me with pseudo code?

Textbox Entries To Show Latest Appended Entries.
How do set a textbox to show the latest appended entry? When data is appended to a text box it always resets to the top of the window. To view the appended data one must scroll down. I would like to keep the latest viewable. Any ideas, please?

Code For Auto Increment Field Values In Datagrid Recordset Entries
Hello Friends

I was creating Master Detail form in visual basic-Oracle8 & want to create auto increment value field for each row of recordset .
Say - Increment - Serial number values in Serial Number column field while making entries.

My Problem :
Could not able to write the code and identifying events for generating incrment values after insert of record in recordset

Note: Serial Number field in not primary/foreign key & can have duplicate values.

So help required to know how to write increment code with revelant events . So whenever new records are being inserted serial number datadrid field IN RECORDSET will generate auto increment values for next records.

Regds

Ashish Dadel

 

HOW ADD CHECK BOXES AND TEXT BOXES IN FLEXGRID
Hi,

i use flexgrid for data entry. i want to add text boxes in column and check boxes in another column. how to add this .

help me.
thanks in advance
bye.

Combo And List Boxes To Text Boxes?
Connecting sub-menus to rich text boxes is fine is most cases but the user does not always want to use menus to load and display text. Applying the same technique as sub menus to text boxes with combo or list boxes just wont work could someone please help me out with this one.

Both combo and list boxes will for example:

Contain an alphabetic list.
When the user clicks on a file it should locate the text file from the drive.
It should then open it into a rich text box on the same form.

Could this be possible?

Please any help will greatly be appreciated.

Saving Text Entries In UserForms
I am using VBA in Reflection, a terminal emulator software. I am building a UserForm to replace a series of input boxes that the user is currently being prompted for. The input boxes have code to save the last entry in the box so that the user does not have to re-enter the same data every time. Is there a way to use code for each text box in a UserForm to store the last entered data, until the user changes it?

Thanks

Grab Text Entries From A Dropdown
How can I grab all the choices in a combobox?

To Check For Blank Entries In A Text Box
Hi friends

First of all let me introduce myself, I am Peters A P. I just started learning VB.

I have a question regarding the following

I have a form, where I want to enter alphanumeric values in the text box and then it should update to the database.

The form has around 25 text boxes, out of which I need to enter complusorily for 10 textboxes. How do I check that and give an error message if I forget to enter one value in one textbox.

I am pasting part of codes below, here I am checking for text1.box whether it is blank, similarly, i need to check for 9 more text boxes. How do I do that


Private Sub cmdSave_Click()
Dim contactrec As New ADODB.Recordset
contactcon.Open "smmdetails"
Set contactrec = contactcon.Execute("Select * from smm_details")
If contactrec.BOF = True Then
If txtBox1.Text = "" Then
MsgBox "Please enter Name of the Firm"
Else
contactcon.Execute ("insert into smm_details(name_of_company, type_of_business, ho_address, ho_city, ho_country, " & _
"ho_tel_no_1, ho_tel_no_2, ho_fax_no_1, ho_fax_no_2, ho_email_1, ho_email_2, ho_website, ho_contact_person, ho_contact_person_mobile, " & _
"local_address, local_city, local_country, local_tel_no_1, local_tel_no_2, local_fax -no, local_email, local_contact_person, local_contact_person_mobile, " & _
"sponsor_name, sponsor_tel_no_1, sponsor_tel_no_2, sponsor_fax_no_1, sponsor_mobile_no, sponsor_email, owner_name, owner_tel_no_1, owner_mobile_no, " & _
"owner_passport, owner_nationality, owner_passport_expiry) Values('" & txtBox1.Text & "')")
End If
Else
MsgBox "Record Already Exists"
End If
contactrec.Close
End Sub

Reverse Entries In A Text File
Hi all..
I have a program I wrote that outputs abnormal program activity to a text file.
Example: Say user tries to choose a non-existant path:
message= "Path error encountered."
Goes to a sub called logme:
sub logme
open "errorlog.txt" for append as #1
print #1, message
close 1

Pretty simple I know.
But what if I wanted to limit the errorlog.txt file size to 100 entries?
Is there a simple way to delete entry #1 when entry #101 is made?

Currently program counts the number of lines in the file before writing to it. If over 100 then it copies everything except entry #1 to another file (erorlog.tmp). It then adds entry 101 to errorlog.tmp.
It then deletes errorlog.txt, renames errorlog.tmp to errorlog.txt. This results in 100 entries, first in-first out.
There has got to be a cleaner way to do this, and I know you are the guys to ask.
Thanks.

Find Previous Entries In Text Box
You know guys how on internet explorer if you previously have entered a string in a text box it remembers every value that has been entered before in that text box and gives you the list. For instance if you are trying to login to a website you start typing your user name. Let's say my user name is hespinoza. If I type "h" then in the list will appear all entries begining with "h" If I type "e" then the list will filter its contents and only display values that start with "he" Does anyone has something that would help me figure this thing out?

Thanks a bunch.

Removing Duplicate Entries In A Text File
I have an email list that has an email address on each line. The problem is that some emails appear more than once in the file.

I'd like to parse out the dups and create a file of non-dups and a file of all the dups

here' the code I have and it sure isn't working. Maybe my brain isn't working right today


Code:
set objFS=CreateObject ("Scripting.FileSystemObject")
set listFile = objFS.OpenTextFile ("BADEMAILS.txt")
set listFile1 = objFS.OpenTextFile ("BADEMAILS1.txt")

set logfile = objFS.CreateTextFile("Final-Removed.txt")
set logfile1 = objFS.CreateTextFile("Final-Removed-dups.txt")

count = 1
do while listFile.AtEndOfStream <> True
line1 = listFile.ReadLine

count1 = 1
listFile1.open
do while listFile1.AtEndOfStream <> True
line2 = listFile1.ReadLine

if line1 <> line2 then
logfile.writeline line2
else
logfile1.writeline line2
end if

count1 = count1 + 1
Loop

listFile1.close

count = count + 1
Loop

BADEMAILS.txt and BADEMAILS1.txt are identical. The only way I could think is to open one file and walk down each line while looping through a different file with the same content parsing out the dups?

Any help would be appreciated

Thanks

Deleting Double Entries In Text Files. How To?
hello,

I have a text file with the following information:
name, address, phone number
I want to use vb to delete entries with the same name, so I would
have only the latest updated information about that name.
how can I do this with vb?

thanks

Remove Duplicate Entries From Text File....
hi, say i have a textbox with numbers like this:


345
645
878
8978
585
64
3
56


how would i make a program which removes duplicate entries from the textbox? i've more or less got a similar bit of code working which works for a listbox, but i'm kinda stuck with how to do it on a textbox. can anyone help?

[solved] Sorting Entries In Text Files
foe example i have a text file named mydbs.txt

the entries inside it are
anything 12.00
others 65.65
helpme 56.76
anyone 96.65
schizo 44.44

how do i get the entries to be sorted where the highest entry is on the top of the file...

Print Text Box Entries To Seperate .txt File
I am very new to VB and am currently trying to work out how to copy each answer from a text box into a .txt file. For instance name and address details. Can anyone help ?

Thanx in advance,

Putting Text File Entries Into An Array
Hey all!

OK, what I want to do is put a whole bunch of names into an array from a text file. The names are already in correct order, all I want to do is get entry #1 into label #1, entry #2 into label #2 etc. How do I do this?

This is what I've got, but I know it doesn't work.


Code:
Private Sub Form_Load()
Dim Name as String, i as String

Open "c:lennycollingwoodfilesPlayers.txt" For Output As #1
For i = 1 To 52
Input #1, Name
lblPlayer(i).Caption = Name
Name = ""
Next i

End Sub



Thanks in advance for any help you can offer.

How To Limit Text Box Character Entries To NUMBERS Only??
How can I make is so that a user can only enter numbers in text boxes?

Thanks

Multiple Text Box Entries On Form To Array
Can anyone help. I have multiple text boxes on a form, and I want the code to go through each text box and put the text in to a 2D array.

The text boxes are created after the user input the number of verticies, 2 verticies creates 4 text boxes done with this code

Private Sub Form_Load()
Dim ctlName As Control
Dim TBox_name As String
Dim Tbox_value As String
Dim i As Integer
Dim Top As Integer
i = 0
Top = 500
TBox_name = "Text"
For i = 0 To Verticies - 1
    Tbox_value = CSng(i + 1)
    TBox_name = TBox_name + Tbox_value
    Set ctlName = Form4.Controls.Add("VB.TextBox", TBox_name, Form4)
    ctlName.Visible = True
    ctlName.Top = Top * (i + 1)
    ctlName.Left = 500
    ctlName.Width = 700
    ctlName.Height = 200
    Tbox_value = CSng(i + 2)
    TBox_name = TBox_name + Tbox_value
    Set ctlName = Form4.Controls.Add("VB.TextBox", TBox_name, Form4)
    ctlName.Visible = True
    ctlName.Top = Top * (i + 1)
    ctlName.Left = 1700
    ctlName.Width = 700
    ctlName.Height = 200
Next
Form4.Height = (Top * (i + 1)) + 500
End Sub

Thanks for your help.

Iain

Deleting Duplicate Entries In A Text File
okay here is my code...i can load the file and add to it and close it and i know how to check for duplicate items, but how can i delete the duplicate entry....

private Sub Form_Load()
Dim Temp as string
lstClient.Clear ' clear current entries
Open "C:
ame.txt" for input as #1
Do Until EOF(1)
Line input #1, Temp
lstClient.AddItem Temp
Loop
Close #1
lblDisplay.Caption = lstClient.ListCount
End Sub

private Sub cmdClose_Click()
Dim X
Open "C:
ame.txt" for Output as #1
for X = 0 to lstClient.ListCount - 1
print #1, lstClient.List(X)
next X
Close #1
Unload me
End Sub




thanx in advance

midnight service

Copyright © 2005-08 www.BigResource.com, All rights reserved