Detect scrollbar - urgent??!!

deBassMan

Registered User.
Local time
Today, 14:51
Joined
Jul 25, 2006
Messages
56
Hi all

Using MS Access 2000, Win XP

I require a way of detecting whether a vertical scrollbar is visible on an Access sub-form.

thanks
 
If the form's scrollbars property is set to 2, then only the vertical bar is present. If 3, both horizontal and vertical are present.

You can check this via VBA.

There's a pretty good explanation in the Access Help.
 
Matt thanks for your reply

but the scrollbars property does not give me what I need (it just sets what can be displayed)

I need to be able to determine whether the subform has invoked a vertical scrollbar (because there are more records displayed in the subform)
 
I'm not sure you can do this without going into the windows api - not a place for the faint of heart :eek: :D .

A possible work around is to check the number of records required to trigger the scroll bar appearing and then use that in a test i.e.


Code:
Dim rst As DAO.Recordset

Set rst = Me.RecordsetClone



if  rst.RecordCount >10 Then

' replace this with the code you want to run if the scroll bar appears
MsgBox rst.RecordCount


end if


Set rst = Nothing

HTH

K.
 
Thanks for your reply Karma.

Can't use your workaround because the subform's record rowheights are user-adjustable.

I think the windows API is the way to go - I'm brave!
 
Hi,

Unfortunatley the api call that i've used in VB6 doesn't work in Access for some reason :confused: I'll keep looking but i don't think i'm going to find out why as it's straight off of MS own knowledge base. The second problem is how would you trigger the event.

K.
 
Yes, I've also struggled with VB6 API routine - which does not work with Access.

I think it's something to do with Access forms hwnd.

Re: trigger
Use the OnCurrent event from the main form?

cheers
 

Users who are viewing this thread

Back
Top Bottom