Vertical Scrollbars in a subform

M

Max

I am having trouble viewing vertical scrollbars in one of
my subforms. I have created an event procedure within On
Current.

' If the number of records in the subform
' is greater than 4, display the
' horizontal and vertical scrollbars.
If Me.RecordsetClone.RecordCount > 4 Then
Me.ScrollBars = 2
Else
Me.ScrollBars = 0
End If

It doesn't seem to take...ideas?

Thanks.

Max
 
J

Jim Allensworth

I am having trouble viewing vertical scrollbars in one of
my subforms. I have created an event procedure within On
Current.

' If the number of records in the subform
' is greater than 4, display the
' horizontal and vertical scrollbars.
If Me.RecordsetClone.RecordCount > 4 Then
Me.ScrollBars = 2
Else
Me.ScrollBars = 0
End If

It doesn't seem to take...ideas?

Thanks.

Max
The RecordCount is only accurate when you do a MoveLast.

Me.RecordsetClone.MoveLast
If Me.RecordsetClone.RecordCount > 4 Then
Me.ScrollBars = 2
Else
Me.ScrollBars = 0
End If

However, there will be a performance hit with MoveLast.
Test and decide for yourself.

- Jim
 
J

Jim Allensworth

Hmmm, that shouldn't cause a problem. Where is the error occuring?
what is the message and number?

Also, try putting a break in code just prior to the code in question
and stepping through it.

- Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top