Add more controls than 755

mrgunner

Registered User.
Local time
Today, 00:45
Joined
Feb 24, 2009
Messages
24
Hi!
I think i´ve read that maximum controls in a report is 755 and I got this message when I try to add more controls:

"Microsoft Office Access can´t create any more controls on this form or report"

I guess there is 755 controls on my report right now but is there a way to go around this? Thanks

/ Markus
 
That's a lot of controls! My only thought would be, can you swap one of those 755 to a subform, then stick the rest in there?

Out of curiosity, what application would require a form to have that many controls?
 
755 is the limit over the life of the form. So if you have added any and deleted them those are also counted. To reset that number, IMPORT (yes, import, not copy and paste) everything into a new blank database shell.
 
Thanks for your answers.

That's a lot of controls! My only thought would be, can you swap one of those 755 to a subform, then stick the rest in there?

Out of curiosity, what application would require a form to have that many controls?

It´s for a schedule on work with 10 people for three month and I want it to look like a spreadsheet and it does, it´s just missing 30 labels that doesn´t fit because the limit of 755. Thats why it´s so many controls :)

It´s only the report who needs all the controls not my forms.
 
Designing an object with so many controls must have been a nightmare.

You should be able to structure the data and design the report to present like a spreadsheet without requiring a separate control for each value and record.
 
Designing an object with so many controls must have been a nightmare.

You should be able to structure the data and design the report to present like a spreadsheet without requiring a separate control for each value and record.
Well, it was a nightmare :) and really irretating when I noticed it didn´t work the way I wanted.

I don´t know how I could do it with less controls? I´ve got a form for each person with all dates where I have comboboxes to choose N (night) or D (Day) and on the report a textbox for all dates where I made the borderstyle solid to make it look like a spreadsheet. I tried a code I found to make it spreadsheet like but I still need all the controls.
 
Last edited:
Asking the obvious... Why not export the results to an Excel template and have each persons workload on a different tab.
 
Asking the obvious... Why not export the results to an Excel template and have each persons workload on a different tab.
I thought about that but I´m not sure how to export from a form in access to a specific cell in excel.
 
Try docmd.transferspreadsheet. You can specify what to export, and where to put it in the sheet.
 
Can you supply a screenshot of your form to give us ideas.

Is you form bound/unbound?
 
The form is bound and sure I can post a screenshot but have to wait until I´m at work.
 
or open a pre-designed excel template, and fill in the values with code


even so, you ought to be able to make it look like a spreadsheet, by thinking about the row data, and displaying it as a datasheet. All you need to do is make sure you have the columns set out right

eg, 30 rows of 26 columns of data = 780 cells.

but you only need worry about what goes in the 26 columns, and let access determine how many rows there are.

you need to try and get this in database terms, rather than spreadsheet terms, as you are missing a large proportion of the power of access
 
So, I found this code and it works good, not great ;)
Is there a way to do the code a little flexible so I could change row when I would like it to? Right now all goes in one row.

Code:
Dim lngColumn As Long
        Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
        Dim dbs As DAO.Database
        Dim rst As DAO.Recordset
        Dim blnEXCEL As Boolean, blnHeaderRow As Boolean

        blnEXCEL = False

        ' Replace True with False if you do not want the first row of
        ' the worksheet to be a header row (the names of the fields
        ' from the recordset)
        blnHeaderRow = False

        ' Establish an EXCEL application object
        On Error Resume Next
        Set xlx = GetObject(, "Excel.Application")
        If Err.Number <> 0 Then
              Set xlx = CreateObject("Excel.Application")
              blnEXCEL = True
        End If
        Err.Clear
        On Error GoTo 0

        ' Change True to False if you do not want the workbook to be
        ' visible when the code is running
        xlx.Visible = True

        ' Replace C:\Filename.xls with the actual path and filename
        ' of the EXCEL file into which you will write the data
        Set xlw = xlx.Workbooks.Open("C:\Documents and Settings\g00010\My Documents\Ny mapp (2)\SCHEMA_KVART.xls")

        ' Replace WorksheetName with the actual name of the worksheet
        ' in the EXCEL file
        ' (note that the worksheet must already be in the EXCEL file)
        Set xls = xlw.Worksheets("Blad1")

        ' Replace A1 with the cell reference into which the first data value
        ' is to be written
        Set xlc = xls.Range("B6") ' this is the first cell into which data go

        Set dbs = CurrentDb()

        ' Replace QueryOrTableName with the real name of the table or query
        ' whose data are to be written into the worksheet
        Set rst = dbs.OpenRecordset("Niklas", dbOpenDynaset, dbReadOnly)

        If rst.EOF = False And rst.BOF = False Then

              rst.MoveFirst

              If blnHeaderRow = True Then
                    For lngColumn = 0 To rst.Fields.Count - 1
                          xlc.Offset(0, lngColumn).Value = rst.Fields(lngColumn).Name
                    Next lngColumn
                    Set xlc = xlc.Offset(1, 0)
              End If

              ' write data to worksheet
              Do While rst.EOF = False
                    For lngColumn = 0 To rst.Fields.Count - 1
                          xlc.Offset(0, lngColumn).Value = rst.Fields(lngColumn).Value
                    Next lngColumn
                    rst.MoveNext
                    Set xlc = xlc.Offset(1, 0)
              Loop
            
        End If

        rst.Close
        Set rst = Nothing

        dbs.Close
        Set dbs = Nothing

        ' Close the EXCEL file while saving the file, and clean up the EXCEL objects
        Set xlc = Nothing
        Set xls = Nothing
        xlw.Close True   ' close the EXCEL file and save the new data
        Set xlw = Nothing
        If blnEXCEL = True Then xlx.Quit
        Set xlx = Nothing
 
I guess I should try this question in th "modules & VBA" section.
 
well its not really a report

...

but why does it go in 1 row or column

just manage the value in the offset statement, surely?
 

Users who are viewing this thread

Back
Top Bottom