Scroll Bars

  • Thread starter Thread starter JKlein
  • Start date Start date
J

JKlein

I need a easy way to activate the scrolll bars when the number of records
exceed 4 on the subform. I have placed this code in the on current event of
the subform:

If Count() > 4 Then
Form.ScrollBars = 2
End If

This doen not work...Can't figure it out. Any suggestions??
 
That won't get the number of records. This will:

(untested)

dim x as long
x=0
with me.recordsetclone
if not (.bof and .eof) then
.movelast
x = .recordcount
endif
end with

Copy & paste that code - don't try to type it, or you might miss some
dots.

You could put it into a function in the form's code module, so you
could call it from other places in that module.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 

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

Back
Top