Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous Forms Vertical Scroll Bar

Status
Not open for further replies.

idbr

MIS
May 1, 2003
247
GB
Hi all,

I have a subform in continuous forms style. Where the visible subform records don't exceed the space available in the subform frame, sometimes a vertical scroll displays, sometimes it doesn't.

It's not exactly a problem as I don't need to scroll, just a bit annoying. I was wondering if anyone knew how to force the scroll bar to display?

Thanks in advance, Iain

PS I run A2k on Win2k

 

'No scroll bars.
me.scrollbars = 0
'Horizonal scroll bar only.
me.scrollbars = 1
'Vertical scroll bar only.
me.scrollbars = 2
'Both scroll bars.
me.scrollbars = 3


Randy
 
Hi Randy,

I've put that into both the main form and the subform's current event and I'm afraid that doesn't work either! Even with a .Repaint! Very odd.

Any other suggestions?

Thanks, Iain
 
There isn't any code Randy, a few bits to turn controls on and off that's it. I'll post it anyway, maybe there *is* something there, you never know...

Note that I simplified above and that the continuous forms subform is nested within a subform that is linked to a main form, hence referencing below.

Main form:

Code:
Private Sub Form_Current()

Dim frm As Form
Dim frm2 As Form

Set frm2 = [Forms]![frmMain]![subfrmContacts].Form



'See if we need to allow additions to the contacts form to show the controls

If DCount("[ContactID]", "[tblContacts]", "CompanyID = " & [Forms]![frmMain]!CompanyID & "And [tblContacts].[DateDeleted] Is Null") = 0 Then

Me!subfrmContacts.Form.AllowAdditions = True

Else

Me!subfrmContacts.Form.AllowAdditions = False

End If

'--------------------------------
'Enable/disable the budget fields
'--------------------------------

If frm2.RespBrand.Value = -1 Then

frm2.BudgetBrand.Enabled = True

Else

frm2.BudgetBrand.Enabled = False

End If


If frm2.RespDirectMail.Value = -1 Then

frm2.BudgetDirectMail.Enabled = True

Else

frm2.BudgetDirectMail.Enabled = False

End If


If frm2.RespMedia.Value = -1 Then

frm2.BudgetMedia.Enabled = True

Else

frm2.BudgetMedia.Enabled = False

End If


If frm2.RespOnline.Value = -1 Then

frm2.BudgetOnline.Enabled = True

Else

frm2.BudgetOnline.Enabled = False

End If


If frm2.RespOther.Value = -1 Then

frm2.BudgetOther.Enabled = True
frm2.RespOtherDescription.Enabled = True

Else

frm2.BudgetOther.Enabled = False
frm2.RespOtherDescription.Enabled = False

End If


If frm2.RespPR.Value = -1 Then

frm2.BudgetPR.Enabled = True

Else

frm2.BudgetPR.Enabled = False

End If


If frm2.RespPrintPurchase.Value = -1 Then

frm2.BudgetPrintPurchase.Enabled = True

Else

frm2.BudgetPrintPurchase.Enabled = False

End If

frm2.Repaint


'-----------------------------------------------------------------
'Enable/disable the buttons on the contact & contact history forms
'-----------------------------------------------------------------


'Set form shortcut
Set frm = frm2!subfrmContactHistory.Form

If IsNull(frm2!ContactID) Then

frm2.cmdContactsPrevious.Enabled = False
frm2.cmdContactsNext.Enabled = False
frm2.cmdContactsDelete.Enabled = False

frm.cmdContactHistoryExpand.Enabled = False
frm.cmdContactHistoryDelete.Enabled = False
frm.cmdContactHistoryFilter.Enabled = False
frm.cmdContactHistoryAddNew.Enabled = False

frm.ScrollBars = 2

GoTo exit_frm_current

ElseIf DCount("[ContactID]", "[tblContactHistory]", "ContactID = " & frm2!ContactID & "And [tblContactHistory].[DateDeleted] Is Null") = 0 Then

frm.ScrollBars = 2

frm.cmdContactHistoryExpand.Enabled = False
frm.cmdContactHistoryDelete.Enabled = False
frm.cmdContactHistoryFilter.Enabled = False
frm.cmdContactHistoryAddNew.Enabled = True
frm2.cmdContactsPrevious.Enabled = True
frm2.cmdContactsNext.Enabled = True
frm2.cmdContactsDelete.Enabled = True

Else

frm.cmdContactHistoryExpand.Enabled = True
frm.cmdContactHistoryDelete.Enabled = True
frm.cmdContactHistoryFilter.Enabled = True
frm.cmdContactHistoryAddNew.Enabled = True
frm2.cmdContactsPrevious.Enabled = True
frm2.cmdContactsNext.Enabled = True
frm2.cmdContactsDelete.Enabled = True

frm.ScrollBars = 2

End If

exit_frm_current:

Set frm = Nothing
Set frm2 = Nothing


End Sub

sub-subform:

Code:
Private Sub Form_Current()
Me.ScrollBars = 2
End Sub



 
How are ya idbr . . .

In [blue]design view[/blue] of the [blue]main form[/blue], decrease the height of the subform control.

The above is not static! If you display even less records the scrollbar will disappear still . . .

Calvin.gif
See Ya! . . . . . .
 
Hi AceMan,

So how come this only happens for some main records and not others? E.g.:

Record 1 - 1 subform entry, scrollbar displayed
Record 2 - 1 subform entry, no scrollbar!!

Just another Access quirk?

Tx, Iain
 
What isn't working? I only see references to scrollbars = 2, which would indicate you want a vertical scroll bar at all times?


Randy
 
That's correct Randy, I wnat a v scroll only, all the time. When I move from record to record, sometimes the scrollbar shows, sometimes it doesn't.

This is irrespective of the setting on the property sheet or setting via code.

There doesn't seem to be a pattern as to when it displays or when it doesn't.

Access... %-)
 
Roger That idbr . . .

Even though the ScrollBars property is set to [blue]Verticle Only[/blue], its [blue]apparently hard coded[/blue] into access when the verticle scrollbar shows!

If for example only 1 record exist in the subform, the scrollbar will never appear until you set the height of the subform control to less than 1 record!

[blue]I hope this makes sense! . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top