|
-
Jan 21st, 2011, 04:05 PM
#1
Thread Starter
New Member
Next & Prev Records Help !!! (and amend/edit help to actually)
Hi again,
after the recent failure of my last post i thought wed forget about that and start fresh, this time i want to be able browse through all my records that have been written in and also be able to to edit the records that were stored,
how do i go abouts doing this ????
code :
Public Class Qoutes
Public Structure Account
Dim CustomerID As Integer 'contains whole qoutes variables
Dim Forname As String
Dim surname As String
Dim dob As Date
Dim telephone As String
Dim address As String
Dim town As String
Dim postcode As String
Dim financeyes As Boolean '
Dim financeno As Boolean
Dim workyes As Boolean
Dim workno As Boolean
Dim salary As Integer
Dim interestrate As Integer
Dim carmake As String
Dim carmodel As String
Dim carcost As Integer
Dim Totalqoute As Integer
End Structure
Dim Accounts() As Account
Dim qoutesfile As String = "E:\Visual Studio 2010\Projects\!! ERROR !!\accounts.txt"
Dim CurrentRecord As Integer = 1
Dim Answer As Integer = 0
Dim NumberofRecords As Integer = 0
Private Sub btnaddqoute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddqoute.Click
If NumberofRecords = 0 Then
ReDim Accounts(1)
Else
ReDim Preserve Accounts(UBound(Accounts) + 1)
End If
NumberofRecords = NumberofRecords + 1
ReDim Preserve Accounts(NumberofRecords)
Accounts(CurrentRecord).Forname = txtforename.Text
Accounts(CurrentRecord).surname = txtsurname.Text
Accounts(CurrentRecord).dob = txtdob.Text
Accounts(CurrentRecord).telephone = txttelephone.Text
Accounts(CurrentRecord).address = txtaddress.Text
Accounts(CurrentRecord).town = txttown.Text
Accounts(CurrentRecord).postcode = txtpostcode.Text
Accounts(CurrentRecord).salary = txtsalary.Text
Accounts(CurrentRecord).interestrate = txtintrestrate.Text
Accounts(CurrentRecord).carmake = txtcarmake.Text
Accounts(CurrentRecord).carmodel = txtcarmodel.Text
Accounts(CurrentRecord).carcost = txtcarcost.Text
Accounts(CurrentRecord).Totalqoute = txttotalqoute.Text
FileOpen(1, qoutesfile, OpenMode.Output)
WriteLine(1, NumberofRecords)
For Count = 1 To NumberofRecords
WriteLine(1, Accounts(Count).CustomerID)
WriteLine(1, Accounts(Count).Forname)
WriteLine(1, Accounts(Count).surname)
WriteLine(1, Accounts(Count).dob)
WriteLine(1, Accounts(Count).telephone)
WriteLine(1, Accounts(Count).address)
WriteLine(1, Accounts(Count).town)
WriteLine(1, Accounts(Count).postcode)
WriteLine(1, Accounts(Count).salary)
WriteLine(1, Accounts(Count).interestrate)
WriteLine(1, Accounts(Count).carmake)
WriteLine(1, Accounts(Count).carmodel)
WriteLine(1, Accounts(Count).carcost)
WriteLine(1, Accounts(Count).Totalqoute)
Next
FileClose(1)
End Sub
Private Sub btnqoutesback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnqoutesback.Click
Me.Hide()
MainMenu.Show()
End Sub
Private Sub Qoutes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btncalcqoute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalcqoute.Click
Dim totalcost As Integer
Dim monthlycost As Integer
totalcost = txtcarcost.Text - txtdeposit.Text
totalcost = ((txtcarcost.Text / 100) * 100 * txtintrestrate.Text)
End Sub
Private Sub btnammenddetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnammenddetail.Click
End Sub
Private Sub btnprevquote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprevquote.Click
End Sub
Private Sub btnnextquote_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnextquote.Click
End Sub
End Class
still new to this if you could give any suggestions that'd be great !!!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|