?
Solved

How to choose the files I want

Posted on 2003-02-19
6
Medium Priority
?
154 Views
Last Modified: 2010-05-01

I made a program which recordes entries and displays the stuff that I entered earlier and it saves in a file that I specified.
And I made a check box to tick so it will also display on the screen later.
I want to filter the records as checked and not checked. The 'unchecked' stuff saves as "0" and checked
ones save as "1". If i can filter the 0s and 1s then i think it would be easy.

I want to view the checked and unchecked both seperatly.
This is the code I used to view all the records.

 Dim strName As String
  Dim intGrade As Integer
  Dim strText1 As String
  Dim strText2 As String
  Dim splitText() As String

  Open "C:\Program Files\Tax Pending\tax.txp" For Input As #1
     Do Until EOF(1)
          Input #1, strText2 'read entire line
        splitText = Split(strText2, Chr(44)) 'split line by " ' "

        strName = splitText(0)
         'splittext is string, convert it to int
        strText1 = splitText(0)

        Form2.Print strName, intGrade, strText1
     Loop
  Close #1

Its like displaying all of them. I told the program to save the 0s and 1s but didn't tell it to display. I hope u got my question.
  check box name is chkCheckBox1.
0
Comment
[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
 

Expert Comment

by:StonedRaider
ID: 7984099
i dont understand your question quite good but here
Form2.Print strName, intGrade, strText1
your telling it to display it
0
 
LVL 2

Expert Comment

by:Jacamar
ID: 7984119
yes, the

Form2.Print strName, intGrade, strText1

is telling it to display in Form2.  I don't quite understand what you are trying to do either.  It sounds like you have a simply solvable problem, but I don't think you've explained it well enough.
0
 

Expert Comment

by:jpwiedenhoff
ID: 7984935
make like this:

take the separated numbers and put them into an if/else check or select case.
I hope you used indexnumbers for your checkboxes else you have to write the code each time.
0
Industry Leaders: 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 2

Accepted Solution

by:
JoaTex earned 80 total points
ID: 7984983
Hi
See if this can Suite You.

form1:
2 Labels
2 ListBoxes (Sorted)
1 Command Button

tax.txp

John,Engeneer,0
Thomas,Web Designer,1
Louis,Sailor,0
Charles,Mechanic,1


Code:

Option Explicit
   Dim strName As String
   Dim strText1 As String
   Dim strText2 As String
   Dim splitText() As String
   Dim strList As String

Private Sub Command1_Click()
   List1.Clear: List2.Clear
   Open "tax.txp" For Input As #1
      Do Until EOF(1)
         Line Input #1, strText2 'read entire line
         splitText = Split(strText2, Chr(44)) 'split line by " ' "
         strName = splitText(0) 'splittext is string, convert it to int
         strText1 = splitText(1)
         strText2 = splitText(2)
         Select Case Val(strText2)
            Case Is = 1
               strList = strName & "      " & strText1
               List1.AddItem strList
            Case Is = 0
               strList = strName & "      " & strText1
               List2.AddItem strList
         End Select
    Loop
 Close #1
 End Sub

Properties:

Begin VB .Form Form1
Caption      =      "Form1"
ClientHeight      =     3075
ClientLeft      =     3285
ClientTop      =     2655
ClientWidth      =     6660
LinkTopic      =      "Form1"
ScaleHeight      =     3075
ScaleWidth      =     6660

Begin VB.ListBox List2
Height           =     1620
Left           =      3390
Sorted           =     -1 'True
Tablndex      =     4
Top           =     630
Width           =     2685
End

Begin VB.ListBox List1
Height           =     1620
Left           =     420
Sorted           =     -1'True
Tablndex      =      3
Top           =     630
Width           =     2655
End

Begin VB.CommandButton Command1
Caption      =      "Load File"
Height           =     375
Left           =     2670
TabIndex      =     0
Top           =     2460
Width           =     1185
End

Begin VB.Label Label2
Caption      =     "Unchecked"
Height           =     225
Left           =     4320
TabIndex      =      2
Top           =     420
Width           =     1035
End

Begin VB.Label Label2
Caption      =     "Cheched"
Height           =      255
Left           =     1200
Tablndex      =     1
Top           =     390
Width           =     825
End
End
0
 

Expert Comment

by:CleanupPing
ID: 8901416
Dileepdhananjayaratanayake:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8959720
Moderator, my recommended disposition is:

    Accept JoaTex's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

770 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