|
-
Nov 6th, 2000, 06:38 PM
#1
Don't give up
Don't give up. Try this: Change AutoRedraw property of the form to True, then use this code:
Code:
Option Explicit
Private m_intLastPos As Integer
Private Sub Scroll()
Dim i As Integer
Me.Cls
For i = m_intLastPos To VScroll1.Max
Me.Print i
Next
m_intLastPos = VScroll1.Value
End Sub
Private Sub Form_Load()
VScroll1.Max = 100
Call Scroll
End Sub
Private Sub Form_Resize()
With VScroll1
.Top = 0
.Height = ScaleHeight
.Left = ScaleWidth - .Width
End With
End Sub
Private Sub VScroll1_Change()
Call Scroll
End Sub
-
Nov 7th, 2000, 04:16 PM
#2
Lively Member
Thanks Serge, worked great.
But how do I get rid of the scrollbar blinking?
-
Nov 7th, 2000, 04:56 PM
#3
I don' think there's a direct way of doing it in VB, but you can use Windows Common Controls 2 which has FlatScrollBar control which is not flashing.
-
Nov 9th, 2000, 12:21 PM
#4
Lively Member
One more thing.
I have got the form to scroll, but when I put in the
following code, it will not. Why?
code:
Sub Scroll()
Me.Cls
With rst
While Not rst.EOF
'display fields
Wend
end with
m_intLastPos = VScroll1.Value
End Sub
-
Nov 9th, 2000, 12:40 PM
#5
Why are you trying to show records from the database on the form when there are plenty conttols that you can use to do that???
-
Nov 9th, 2000, 01:33 PM
#6
Lively Member
Thanks for your quick reply Serge, but let me explain
what I'm trying to do, and I'll appreciate your continued help.
I'm giving the user the option of either spooling a report
to the screen or the printer.
I populate a recordset with fields from a db using a SQL
query, of which I would like to display on the screen.
That's where the code for displaying the query to the screen
comes in. So, if I'm going about it the wrong way, please
let me know, and I'm looking forward to your suggestions. 
-
Nov 9th, 2000, 02:42 PM
#7
VB comes with Crystal Reports that you can use. It is really easy to use. Basically, you create a template of the report and then call the report from VB.
-
Nov 9th, 2000, 03:37 PM
#8
PowerPoster
What about a grid
What if you loaded your data into a grid? This would eliminate the form scroll necessity since the grid has the scroll bar. You could then print the contents of the grid using VB Printer.Print ...
Just my opinion.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 9th, 2000, 04:00 PM
#9
The only problem with the grid is that you have to take care of the printing functionality manually, which can be a big piece of work, where with Crystal Reports it's all built-in.
-
Nov 10th, 2000, 09:53 AM
#10
Lively Member
I hope I'm not asking too much, but how do I do that?
-
Nov 10th, 2000, 06:45 PM
#11
PowerPoster
Do what?
What is it you want to do?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 10th, 2000, 06:54 PM
#12
PowerPoster
If you want...
If you want to know how to add data to a grid...
You can loop each record in your database then,
mydata _
= rst!EmployeeFull _
& vbTab & Rst!PCSNO _
& vbTab & rst!Classification _
& vbTab & Format(SUN, "#0.00") _
& vbTab & Format(MON, "#0.00") _
& vbTab & Format(TUE, "#0.00") _
& vbTab & Format(WED, "#0.00") _
& vbTab & Format(THU, "#0.00") _
& vbTab & Format(FRI, "#0.00") _
& vbTab & Format(SAT, "#0.00") _
frmWeeklyPayroll.MSFlexGrid1.AddItem mydata
Just an example...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 21st, 2000, 05:53 PM
#13
Lively Member
Thanks for you help guys, I have finally got it working.
I basically loaded the records from a rst into a array,
and then print the array to the form.
The only problem now is that the scrollbars blink, and
to a lesser degree, the form will scroll with less than
one page of text.
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
|