Hello friendz
im working on "feedback form analysis" project
the first main aim of my project is to store data submitted by the user from the feedback form in a file which can be accessed randomly. For that.... i wrote the following code:
CODE
Option Explicit
Private Type feedbackdata
Laboratory(0 To 4) As byte
Library(0 To 4) As byte
Teaching(0 To 4) As byte
End Type
Dim recordnum As Long
Private Sub cmdSubmit_click()
Dim feedback As feedbackdata, Index As Integer
Open "C:\student.txt" For Random As #1 Len = Len(feedback)
With feedback
For Index = 0 To 4
.Laboratory(Index) = Abs(OptLaboratory(Index).Value)
.Library(Index) = Abs(OptLibrary(Index).Value)
.Teaching(Index) = Abs(OptTeaching(Index).Value)
Next Index
End With
recordnum = recordnum + 1
Put #1, recordnum, feedback
Close #1
cmdReset_click
End Sub
Private Sub cmdReset_click()
Dim Index As Integer
For Index = 0 To 4
OptLaboratory(Index).Value = False
OptLibrary(Index).Value = False
OptTeaching(Index).Value = False
Next
End Sub
Basically my form consists of 10 questions and 5 option buttons for each question. If an option is selected for a particular question,
1 should be written in the file and if option is not selected a
0 should be written.
For eg., for a question suppose 2nd option was selected and was submitted...the compiler should write the following in the file
QUOTE
0 1 0 0 0
The compiler should be able to write the result for every question in terms of 0's and 1's in a new line.
There should be a marker to indicate the start and end of form in the file
could u plz help me...??
This post has been edited by dee2020: 15 Jan, 2008 - 03:44 PM