continuous form that allows users to resize and reorder columns like a datasheet (1 Viewer)

CJ_London

Super Moderator
Staff member
Local time
Today, 23:05
Joined
Feb 19, 2013
Messages
14,221
I developed this because datasheets have some useful functionality, but limitations as well - among them
  • Datasheets can't show controls such as buttons, images, attachments, etc
  • Datasheets can't show a record over multiple rows within the detail section
  • Datasheets don't have header and footer sections
  • Sometimes the 'look' of a datasheet doesn't fit with the overall look of your app
So if you require any of the above, you can't use a datasheet - and sometimes it is useful for the user to be able to resize and rearrange columns when those requirements are necessary

Please note this is a 32bit .accde and wont work on 64bit versions of Access. I hope to create a 64bit in the near future

The attached file (ContinuousDS.accde) has a number of forms you can select to demonstrate a variety of scenarios and change the properties of each form by modifying the parameters
1638063491118.png

click 'Show Form' to apply the the parameters

To use in your own project do the following

In your app VBE window click on tools>references then browse to this file (change type of file to .accde) and select it. Library files can be in the same folder as the calling app so easy to redistribute to other users

Then for each form you want to apply this to the form module:

Code:
Option Compare Database
Option Explicit
Dim cfrm  As ContinuousDSLib.clsContDSForm

'and in the form load event put

Private Sub Form_Load()

    Set cfrm = ContinuousDSLib.New_clsContDSForm
    'set parameters as required - for multi layered forms, populate the seed with the name of a header control on each layer separated by a comma e.g. "Label0,Label7"
    cfrm.setLayout Me, "Label0", True, True, 0, 50

End Sub

'and the unload event

Private Sub Form_Unload(Cancel As Integer)

    Set cfrm = Nothing

End Sub

I have included another file (ContDS using Lib.accdb) which demonstrates using the library. It is simply a db with one table and the continuous form created using the multiple items form wizard, then just added the above code.

Click on an item in this list for more information
1638068035924.png


edit: file updated with a minor change to instructions
 

Attachments

  • ContinuousDS (2).zip
    710.8 KB · Views: 319
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:05
Joined
May 7, 2009
Messages
16,129
only small comment:
very nice.
also the form on .accde is working but that on .accdb is not, please check.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:05
Joined
Feb 19, 2013
Messages
14,221
on .accdb is not, please check.
Thanks for pointing that out - the resize worked, but I'd forgotten to remove layouts so you could move columns around. Have updated the attachment with a corrected .accdb
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:05
Joined
May 7, 2009
Messages
16,129
on the moving of control it seems that you are just adding X to the
left of both the label and corresponding textbox control when
the mouse is depressed.
i'll test more.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:05
Joined
Feb 19, 2013
Messages
14,221
Not sure if you are saying there is a problem?

when the mouse is depressed, the app picks up the X parameter value, when the mouse moves it picks up the new X parameter and compares with the mousedown X value to determine how much the mouse has moved
 

Users who are viewing this thread

Top Bottom