"Freeze Panes" in Form view

That is pretty neat:). And overall, really easy to follow

I've been playing around with freezing using the standard scrollbar and getscrollinfo api - but there is too much flicker. My purpose is slightly different which is to keep a control top right (or left) of the window of a horizontally scrollable form - similar to the window controlbox. I can see the issue - the 'normal' scrollbar scrolls a pixel at a time rather than a column at a time
 
Thanks
There is no flicker using this approach (and no APIs). The only non-standard feature is the use of an ActiveX scrollbar for horizontal scrolling
One advantage of the ActiveX scrollbar is that you can set the size of movement (small change/large change)
 
Agree - just not keen on the flashing thumb🙂
 
it's not working like in datasheet view where you an use TAB/BackTab key to goto next column.
 
it's not working like in datasheet view where you an use TAB/BackTab key to goto next column.
Of course it isn't - its a continuous form - not a datasheet

Labels cannot get focus and aren't part of the tab order
Clicking on a control (not the header label) and using the tab/back tab key goes to the next/previous column

You could use transparent buttons instead of labels for headers but you'd still need to 'tie' the buttons and field controls.
 
Last edited:
Of course it isn't - its a continuous form - not a datasheet
of course it continuous!!! so where is the freezing you are talking about?
on the scrollbar only?:rolleyes:
 
Last edited:
so i am correct, it is only freeze using the ActiveX scrollbar.
using Tab key does not freeze it, so it is half baked.
Application should be robust.
 
With respect @arnelgp Colin's example is just that, an example. I don't believe it is intended as a fully working, ready to go exact duplicate of a datasheet. But if you wanted to 'freeze on tab', it is relatively easy to do so, but ultimately depends on the user requirements. Adding the following code will retain the viewable columns when going to the next record when tabbing, unlike a datasheet which will return you to the first unfrozen column when to tab of the last frozen one. For some this would be seen as an improvement over the way a datasheet works, for others they want the same functionality as a datasheet.

add this code to the form module

Code:
Function tabScroll()

    With Screen.ActiveControl
    
        If .Left + .Width >= InsideWidth Then
        
            MainScrollBar.Value = MainScrollBar.Value + 1
            MainScrollBar_Updated (MainScrollBar.Value)

        End If
        
    End With

End Function

and for each control in the detail section, add =tabScroll() to the gotfocus event (instead of [Event Procedure])

Another variation would be to lock the frozen columns so they cannot be selected, so tabbing only works on the unfrozen columns - again, not datasheet functionality, but some would find it useful
 
not datasheet functionality, but some would find it useful
i would rather wait for ms to do it since they have the "deep" knowledge and the creator of such.
 
As @CJ_London said earlier this was intended as a way of replicating some of the functionality of datasheet forms in a continuous form.
It does exactly what was described in the linked article and is totally robust in doing exactly what it was intended to do.

However, as I rarely navigate forms using the tab key, I didn't think to include functionality to handle frozen columns on tabbing.
That certainly doesn't make it 'half baked' as @arnelgp suggests.

However adding that functionality doesn't appear to be too difficult
I already have a solution for scrolling using the tab key (similar to the suggestion in post #29) and am now working on Shift+Tab.
I will publish an updated version when that is done.

As always, I'm extremely grateful to @arnelgp for his highly constructive feedback to help improve my example apps!
What would I do without your support ...? 🙄
 
As always, I'm extremely grateful to @arnelgp for his highly constructive feedback to help improve my example apps!
What would I do without your support ...? 🙄
there is always that balance in nature.
even in politics they call them minority and majority.
good and evil.
negative and positive.
each holding each other.
if all are the same, there is imbalance is created and will collapse.
 
Following the recent prompt about tab navigation, I've just uploaded an updated version (2.9) of my example app to my website:


In addition to the ActiveX scrollbar, this version allows you to navigate using the Tab / Shift+Tab keys whilst keeping the frozen columns fixed in position. It also supports use of the Up/Down & Left keys

ShiftTabScroll2.png

As before the number of frozen columns can be specified & optionally locked. The form can be filtered and sorted

8FrozenFilteredSortedScrolled.png

No APIs are used so it will work in in all versions from A2010 through to A365 (both 32-bit & 64-bit)

Overall it now closely replicates the functionality of the freeze fields feature in datasheets whilst adding extra features
 

Attachments

Users who are viewing this thread

Back
Top Bottom