Michael R Mattys
mmattys at rochester.rr.com
Sun Feb 11 15:19:32 CST 2007
Hi Arthur, Thanks for not complaining ... here's the rest. Sub TestFC() 'NumRows, NumCols, and Modifier are always same FormCreator 7, 7, 7, "Seven" End Sub Sub FormCreator(NumRows As Integer, NumCols As Integer, Moderator, MyForm As String) 'Michael R Mattys 2000 Dim frm As Form Dim ctlTxt As Control, ctlLabel As Control Dim intColumn As Integer, intRow As Integer, i As Integer, J As Integer Dim intL As String, intT As String, intW As String, intH As String intL = 0 intT = 30 intW = 940 intH = 275 intColumn = 1 intRow = 1 Set frm = CreateForm(, "frmSpreadSheet") With frm .tag = "SS" .Width = 6.875 * 1440 .AutoCenter = False .BorderStyle = 1 .DefaultView = 0 .DividingLines = False .RecordSelectors = False .NavigationButtons = False .ScrollBars = 0 .PopUp = True .OnOpen = "=SSInit([Form])" .HasModule = True Set ctlLabel = CreateControl(frm.Name, acLabel, acDetail, , , 10, 10, 10, 10) With ctlLabel .Properties("Caption") = "HWND" .Properties("Name") = "lblHwnd" .Properties("Visible") = False End With For i = 1 To NumRows For J = 1 To NumCols Set ctlTxt = CreateControl(frm.Name, acTextBox, acDetail, , , intL, intT, intW, intH) With ctlTxt .Properties("Name") = "Col" & intColumn & "Row" & intRow .Properties("BackColor") = "13421619" End With intL = intL + 1000 intColumn = intColumn + 1 Next J If intColumn Mod (Moderator + 1) = 0 Then intColumn = 1 intL = 0 intT = intT + 300 intW = 940 intH = 275 intRow = intRow + 1 End If Next i .Width = CLng(intW * NumCols) .Section(0).Height = CLng(intH * NumRows) End With Dim FN As String FN = frm.Name DoCmd.Save acForm, FN DoCmd.Close acForm, FN DoCmd.Rename MyForm, acForm, FN CurrentDb.Containers("Forms").Documents.Refresh DoCmd.OpenForm MyForm, acNormal End Sub Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: <artful at rogers.com> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Sunday, February 11, 2007 11:30 AM Subject: Re: [AccessD] Abstract question > Thanks Michael! I shall play around with this and see if it can work. > > Arthur Fuller > Technical Writer, Data Modeler, SQL Sensei > Artful Databases Organization > www.artfulsoftware.com > > > > > ----- Original Message ---- > From: Michael R Mattys <mmattys at rochester.rr.com> > To: Access Developers discussion and problem solving > <accessd at databaseadvisors.com> > Sent: Sunday, February 11, 2007 11:19:20 AM > Subject: Re: [AccessD] Abstract question > > > I forgot this part ... > > '-----Module1----- > Public Function SSInit(ByRef rfrm As Form) > Dim obj As New clsSpreadSheet > obj.Init rfrm > End Function > > Public Sub AddSpreadSheets() > Dim frm1 As New Form_Spreadsheet > Dim frm2 As New Form_Spreadsheet > Dim frm3 As New Form_Spreadsheet > With frm1 > .Visible = True > DoCmd.MoveSize , 0 > End With > With frm2 > .Visible = True > DoCmd.MoveSize , 500 > End With > With frm3 > .Visible = True > DoCmd.MoveSize , 1000 > End With > End Sub > > Sub OpenSpreadSheets(NumberOfSS As Integer) > Dim i As Integer, f As Form, h As Long, r As Integer, d As Integer, M > As > Integer > r = 100 > For i = 1 To NumberOfSS > r = r + 500 > Set f = New Form_Spreadsheet > With f > d = M + f.Section(0).Properties("Height") > .Caption = .Name & i > .Visible = True > h = .hwnd > DoCmd.MoveSize , d > End With > d = d + d > Next > End Sub > > Michael R. Mattys > MapPoint & Access Dev > www.mattysconsulting.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com