Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FlexGrid

Posted on 1998-06-18
3
Medium Priority
?
633 Views
Last Modified: 2012-05-04
Can someone tell me how to Autosize the Row height in a Flex Grid.  I have a Memo field that will contain a large amount of text and need to be able to read it all.  Either Autosize the row or provide some type of scrolling ability so as to be able to view ALL the data in the field
0
Comment
Question by:warrencc
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 200 total points
ID: 1463711
Here's the easy answer.

Add a label on the same form as the flexgrid.  Set the labels properties:
Name = lblCellText
Caption = "" (Nothing)
Autosize = True
Visible = False

Now when you add data to the grid, use this code (replace nRow and nCol with the row and column you need):
  MSFlexGrid1.TextMatrix(nRow, nCol) = "Now is the time for all good men to come to the aid of their country."
  lblCellText.Width = MSFlexGrid1.ColWidth(nCol)
  lblCellText.Caption = MSFlexGrid1.TextMatrix(nRow, nCol)
  MSFlexGrid1.RowHeight(nRow) = lblCellText.Height + 240

0
 

Author Comment

by:warrencc
ID: 1463712
If I am using column 6 all the time and need this capability in all rows how should I change the (nRow and nCol).  Sorry for needing the detailed explaination.....
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1463713
Create the following subroutine in the form which has the flexgrid:

Private Sub FixFlex()
  Dim nRow As Integer

  lblCellText.Width = MSFlexGrid1.ColWidth(6)

  For nRow = 1 to MSFlexGrid1.Rows - 1
    lblCellText.Caption = MSFlexGrid1.TextMatrix(nRow, 6)
    MSFlexGrid1.RowHeight(nRow) = lblCellText.Height + 240
  Next nRow
End Sub

Now call FixFlex right after adding data to the FlexGrid or after refreshing your data control.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question