|
-
April 11th, 2001, 03:53 AM
#1
Next 20 button?
I am trying Display the contents of the file on a form, 20 at a time. I can do this but i cant get ut to show the next 20 and the next 20 behind the same button. any suggestions
-
April 11th, 2001, 05:01 AM
#2
Re: Next 20 button?
Post your code.
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
April 11th, 2001, 05:07 AM
#3
Re: Next 20 button?
Private Sub cmdNext_Click()
'when clicking on next button
'move the pointer(fCurRec) forwards
'If fCurRec < gNumRecs Then
'fCurRec = fCurRec + 1
'Else 'Unless were at the last record
'fCurRec = 1 'wrap around to 1st record
'End If
' No We Display the Array Element
' In the Text Boxes
Dim CurList As Integer
Cls
CurList = 1
dblNum = I
Print "Name", "Telephone Number" & _
vbCrLf & "------------------------------------------------------"
CurList = CurList + 1
For I = 1 To 20 'dblNum is my total loaded data so I = 1 to dblNum
Print gStreetNum(I); Tab(13); gStreetName(I); Tab(34); gSuburb(I); Tab(59); gPostalCode(I); Tab(74); gPrice(I)
Next I
Print "End of list"
End Sub
-
April 11th, 2001, 05:28 AM
#4
Re: Next 20 button?
Have a static variable and increment this on every click. e.g.
private Sub cndNext_Click()
static StartFrom as Long
'\\ as your code then...
for I = (StartFrom + 1) to (DtartFrom + 20)
'\\ as your code
next I
'\\ Now increment the startfrom
StartFrom = StartFrom + 20
End Sub
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
April 11th, 2001, 05:31 AM
#5
Re: Next 20 button?
dblNum = I
where does I come from? you said your total loaded data.
So, I assume it may be greater than 20.
If it is right, and what are you looking for is a way to print on form other 20 at a time, this is the line to change:
static oldcount as integer
dim addcount as integer
addcount = oldcount*20
For I = 1 To 20 'dblNum is my total loaded data so I = 1 to dblNum
'dblNum may be greater than 20?
Print gStreetNum(I+addcount); Tab(13); gStreetName(I+addcount); Tab(34); gSuburb(I+addcount); Tab(59); gPostalCode(I+addcount); Tab(74); gPrice(I+addcount)
Next I
oldcount = oldcount+1
do not forget to reset oldcount to 0 when you read a new record or you reach the end of the array
Hope I got the point and this helped you.
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
April 11th, 2001, 05:32 AM
#6
Re: Next 20 button?
As usual, you're more direct, faster and clearer!
Only a pity I am out of vote for today...
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
April 11th, 2001, 05:56 AM
#7
Re: Next 20 button?
thanks a million dude? cheers!
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
|