473,383 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to travel between Previous and Next Records

Ok, so here it is. I'm writing a basic code for my class and have had no luck when it comes to transfering between records. The Next Record Command works perfect but I have no idea what to code for the Previous Command button. If anyone has any ideas or suggestions PLEASE let me know... Here is the code so far, (the cmdPrevious click event is left blank because I have no idea what to put in there)

Expand|Select|Wrap|Line Numbers
  1. 'Team 14
  2. 'This form allows the user to view the data in the text file.
  3.  
  4. Option Explicit
  5. Private intAccountInformation As Integer
  6.  
  7. Private Sub cmdNext_click()
  8.   Dim strRecord As String * 112
  9.   Dim strName As String * 30
  10.   Dim strAddress As String * 35
  11.   Dim strCity As String * 25
  12.   Dim strState As String * 2
  13.   Dim strZip As String * 5
  14.   Dim strAccount As String * 6
  15.   Dim strBalance As String * 7
  16.   Dim curBalance As Currency
  17.   Get #intAccountInformation, , strRecord
  18.   If EOF(intAccountInformation) Then
  19.     MsgBox "There are no more records in the file."
  20.   Else
  21.     strName = Mid(strRecord, 1, 30)
  22.     strAddress = Mid(strRecord, 31, 35)
  23.     strCity = Mid(strRecord, 66, 25)
  24.     strState = Mid(strRecord, 91, 2)
  25.     strZip = Mid(strRecord, 93, 5)
  26.     strAccount = Mid(strRecord, 97, 6)
  27.     strBalance = Mid(strRecord, 105, 7)
  28.     curBalance = CCur(strBalance) / 100
  29.     lblBalanceData.Caption = Format(curBalance, "$0.00")
  30.     lblNameData.Caption = strName
  31.     lblAddressData.Caption = strAddress
  32.     lblCityData.Caption = strCity
  33.     lblStateData.Caption = strState
  34.     lblZipData.Caption = strZip
  35.     lblAccountData.Caption = strAccount
  36.   End If
  37. End Sub
  38.  
  39. Private Sub cmdPrevious_Click()
  40.  
  41. End Sub
  42.  
  43. Private Sub form_load()
  44.   Dim strAccountInformation As String
  45.   intAccountInformation = FreeFile
  46.   strAccountInformation = App.Path & "\OutPutFile.txt"
  47.   Open strAccountInformation For Random Access Read As #intAccountInformation Len = 112
  48. End Sub
  49.  
  50. Private Sub cmdExit_click()
  51.   Unload Me
  52. End Sub
  53.  
  54. Private Sub form_unload(cancel As Integer)
  55.   Close #intAccountInformation
  56. End Sub
  57.  
Oct 21 '06 #1
0 1291

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Wm | last post by:
I'm trying to get a handle on the best way to handle setting up my listings so that I display groups of about 25 records per page. I currently have a page that returns over 1,000 names/addresses,...
10
by: george | last post by:
Can anyone help? I query a database and return a result on the column "reference". There might be 7 listings. Each row is displayed in a table, with links through to a detail page. I am working...
5
by: Bob Bedford | last post by:
Does exist a next prev function in PHP/Mysql. I've a website with returns lot of records (say about 200). The user may browse trough the list or returned records, but he has to click the record...
9
by: Leroy | last post by:
I really need some help with showing pages of results from queries in say like groups of 20 with next and previous buttons or links. I'm having a lot of trouble figuring out the logic of such a...
3
by: Marcel | last post by:
Hello, I'm working on a search application for my website. The website contains a lot of pictures, and a search should return clickable thumbnails. No problems there. My problem started when I...
2
by: eeh | last post by:
Hi, Suppose I have a table "product" with fields id,name,price. I want to get a resultset of previous and current and next record when the resultset is sorted by id and id=10. The table data is...
9
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions...
1
by: allyn44 | last post by:
Hello, I have a table that has null fields that need to be filled in with the value of the previous record (example below) id date 1 2/2/02 2 3 4/4/02 4
13
by: sweetline priya | last post by:
in my project, a table called 'hardware' contains merely 5000 records..its a mysql database.. the user can add, modify or can view this hardware details one by one.. while clicking 'view' button, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.