No Vertical Scroll Bar on Form When Needed

way2bord

Registered User.
Local time
Today, 10:44
Joined
Feb 8, 2013
Messages
177
I have a continuous form that is excessively tall.

It has a single record when filtered.

The vertical scrollbar doesn't appear. I can't see the bottom of the form. How do I enable the scroll bar?

:banghead:

attachment: example included
- Please open testform, then attempt to view bottom of testform.
 

Attachments

Worked for me :confused:

attachment.php
 

Attachments

  • Capture.PNG
    Capture.PNG
    11.6 KB · Views: 2,674
Belay that :eek: there's some weirdness going on in that form :banghead:
 
I suspect that your form may have got corrupted somewhere along the line.

I've created a new form that does work :D
 

Attachments

Thank you for the attempt.

A few differences in our forms:

Mine:
Default View = Continuous
Record Source bound to table
Single Record view due to result of filter and/or other criteria

Yours:
Default View = Single
No record source

The problem arises when there's a continuous form that, due to filter or other recordset reduction, has a resulting view of a single record. Result - no vertical scrollbar.

Edit:
I have an idea that the problem is the built-in functionality for the way a scrollbar interacts on a continuous form. Continuous form vertical scrollbar results in scrolling through recordsets, Single form vertical scrollbar results in scrolling through form.

Am I trying to get a continuous form scrollbar to interact in an impossible manner?
 
Take a look at this then. As I said; My guess is your form got corrupted somehow. Delete it and start again from scratch.
 

Attachments

I really appreciate the help - this is very very close.

3 changes to the file you provided:

1. add a filter to the form: test = "Test2" 'this will filter to a single value in our test table

2. Filter on Load = Yes 'this will enable filter on opening form

3. Allow Additions = No 'this will prevent a 2ndary 'blank/Null form' from being created

This will result in a single filtered record selected from our table. We will then attempt to view that record in a continuous form.

Result = break.

I'm fairly sure it's not corruption - it's an easily repeated glitch.


Goal: View single record in tall continuous form, keep vertical scrollbar.
 
OK I see what you mean.

This is how I would get around your little problem. I would use a command button on another form to open your form and use the following code to open the form to either Single form if this is only a single record or to continuous view if there are multiple records.

Code:
    DoCmd.OpenForm "Form1", acDesign   [COLOR="Green"] 'Open the form in design view so the default view can be set[/COLOR]
    
    If DCount("test", "_testtbl", test = "Test2") = 1 Then  [COLOR="Green"]'Test for the expected number of records[/COLOR]
        Forms!form1.DefaultView = 0                     [COLOR="Green"]'Set to single form[/COLOR]
        DoCmd.Close acForm, "Form1", acSaveYes   [COLOR="Green"]'close and save design changes[/COLOR]
        DoCmd.OpenForm "Form1"                         [COLOR="Green"]'Re-open the form[/COLOR]
        
    Else
        Forms!form1.DefaultView = 1                       [COLOR="Green"]'Set to continuous view[/COLOR]
        DoCmd.Close acForm, "Form1", acSaveYes     [COLOR="Green"]'close and save design changes[/COLOR]
        DoCmd.OpenForm "Form1"                          [COLOR="Green"] 'Re-open the form[/COLOR]
    End If
 
Last edited:
Here's that code, modified so it is more dynamic, implemented in your DB.

Thanks, it's been an interesting little challenge :D
 

Attachments

OK I see what you mean.

This is how I would get around your little problem. I would use a command button on another form to open your form and use the following code to open the form to either Single form if this is only a single record or to continuous view if there are multiple records.

Code:
    DoCmd.OpenForm "Form1", acDesign   [COLOR=green]'Open the form in design view so the default view can be set[/COLOR]
 
    If DCount("test", "_testtbl", test = "Test2") = 1 Then  [COLOR=green]'Test for the expected number of records[/COLOR]
        Forms!form1.DefaultView = 0                     [COLOR=green]'Set to single form[/COLOR]
        DoCmd.Close acForm, "Form1", acSaveYes   [COLOR=green]'close and save design changes[/COLOR]
        DoCmd.OpenForm "Form1"                         [COLOR=green]'Re-open the form[/COLOR]
 
    Else
        Forms!form1.DefaultView = 1                       [COLOR=green]'Set to continuous view[/COLOR]
        DoCmd.Close acForm, "Form1", acSaveYes     [COLOR=green]'close and save design changes[/COLOR]
        DoCmd.OpenForm "Form1"                          [COLOR=green] 'Re-open the form[/COLOR]
    End If

Thanks for constant assist. That VBA is the work around I was thinking of, but I was really hopeful there was an easy little force.vertical.scrollbar = true. :D
 

Users who are viewing this thread

Back
Top Bottom