473,465 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Making Continuous Forms Work Like Datasheets with Adjustable Columns

I've seen a lot of posts asking how to get Datasheet-like
functionality into a Continuous Form. One of the obvious missing
elements is adjustable column widths. I had the same need so I created
the following code:

On a continuous form, in the Form Header section, between two heading
labels, create a box with the height equalling the header height and
the width = 0.1576". Name this box BoxColumn1.
Create two text boxes named LeftColumName and RightColumName
Rename the labels for these text boxes to LeftColumLabel and
RightColumLabel

Add this code to the OnMouseMove event of BoxColumn1:
'START CODE
************************************************** ***************************************
Dim intLeftButton As Integer
Dim ColumOneAdjust as Integer
Dim ColumTwoAdjust as Integer

intLeftButton = Button And acLeftButton
ColumOneAdjust = 60
ColumTwoAdjust = 800

' as you move over the box, the pointer will change to the left-right
size arrows:
Screen.MousePointer = 9

' only if you click the left mouse button will you're over
BoxColumn1 will it size, otherwise just pass over the box:
If intLeftButton 0 Then

'now calculate all the sizes:
If (Me.BoxColumn1.Left + x) - ColumOneAdjust >
Me.LeftColumName.Left + ColumTwoAdjust And Me.BoxColumn1.Left + x <
Me.ContactsType.Left - 1200 Then
Me.BoxColumn1.Left = Me.BoxColumn1.Left + x
Me.BoxColumn1Row.Left = Me.BoxColumn1.Left
Me.LeftColumName.Width = (Me.BoxColumn1.Left -
Me.LeftColumName.Left) - 100
Me.LeftColumLabel.Width = Me.LeftColumName.Width
Me.RightColumName.Width = Me.ContactsType.Left -
(Me.RightColumName.Left + 60)
Me.RightColumName.Left = Me.BoxColumn1.Left + 60
Me.RightColumLabel.Left = Me.RightColumName.Left
Me.RightColumLabel.Width = Me.RightColumName.Width
End If

End If

'END
CODE********************************************** ************************************************** ******

You will have to adjust the values for ColumOneAdjust and
ColumTwoAdjust to limit the left to right adjustment of your columns
based on the width of the columns you need.

Repeat this for all columns you wish to create and adjust in your
continuous form.

I hope this helps,
lq
Nov 16 '07 #1
0 2128

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: NA | last post by:
Is it possible to have adjustable tables (not Access tables per se) but those in Ms Word or Excel based on nexted forms three deep? In other words, if I have a main form, Repair History, both the...
0
by: Thorsten Bast | last post by:
Hi, I'm sorry if this problem should have been sufficiently discussed here, but so far I could not find a satisfactory answer. I'm managing rental contracts with an access database and want to...
6
by: Rose | last post by:
I have set my form's default view property to continuous forms and have added a field for the table columns I wish to view. What do I need to do to allow more than one record to show at the same...
3
by: Richard Hollenbeck | last post by:
I have the following query in my form's code: Private Function Get_Data(fieldNum As Integer) Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset strSQL = "SELECT & "", "" & ...
1
by: jodyblau | last post by:
I have a form that is in Continuous form. In each record there is a button next to the a date box. When the button is pushed, the calendar control is set to visible (rather than in a seperate pop...
3
by: Richard | last post by:
How is the result of query placed in a unbound textbox ? Suppose CriteriaLookups has columns TableName, KeyColumn, KeyValue, DataColumn Foo,x,11,xhat Bar,z,3,xyzzy And
1
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each...
2
by: Kevin | last post by:
I want to use a set of check boxes to narrow down entries on a subform. I.e. a check box for black, red & green to describe the colors of a product. So a use clicks Black and only black products...
4
by: RLN | last post by:
re: Access 2003 I have a field called SentByMethod the displays a 'zero', '1' or '2'. I am trying to set up a text field that shows "Sent by X" if it's 0, "Sent by Y" if it's 1, and "Sent by Z"...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.