Date: Wed, 01 Aug 2001 14:14:10 -0500 (CDT) From: Mark Jacobson To: 810-030-01@uni.edu Subject: Column Width for film names.... Hi Visual Basic students, Here is some of the code we did in class this morning. Recall that the 2nd form we made for the Northwinds.mdb database was named frmFlex, cause it had the Microsoft Flexgrid control. The 1st column of the MSFlexGrid control is useless, except for more advanced applications, so I made it disappear by setting its width equal to 0. The 2nd column would contain the movie names, if our Query is SELECT ProductName FROM Product ORDER BY Len(ProductName) DESC -------------------------------------------------------------- for example (in the NWind.mdb or Northwind.mdb example context). Recall that DESC stands for DESCending order. Anyway, here is the code that reviews what we did this morning. ---------------------------------------------------------------------------- ' The frmFlex FORM that has the FlexGrid control - lab Aug 1, 2001 ' 1. How do I make the column width wider, so the entire ' movie name (Stars.film) is shown (column #1)? ' See the last line of code in Form_Load(). ' 2. How do I make the useless gray column (#0) disappear? ' See the 2nd to last line of code. ' 3. How do I set this dialog box to portray the same set ' of database records and same SQL query recordset ' that we were seeing on the main form (Movie Guessing ' game form is main form, show Movie or film names is ' the secondary form). See 1st 3 lines of code in Form_Load() ' This is the FORM_LOAD event for the frmFlex Form. ' The 1st Form, that allowed us to bring up this 2nd form, has the ' name Form1, the default name. Private Sub Form_Load() SQL = Form1.Data1.RecordSource Data1.RecordSource = SQL Data1.Refresh MSFlexGrid1.ColWidth(0) = 0 MSFlexGrid1.ColWidth(1) = 3 * MSFlexGrid1.ColWidth(1) End Sub --------------------------------------------------------------------------- Mark