Results 1 to 8 of 8
  1. #1
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48

    Sizing of a report

    Hi,

    Could someone please help me with customizing my report(s) to do the following:

    1. It opens as a 1/4 of the screen - need it to open full screen.
    2. I have played around with code to hide the access toolbars on startup, but now I have a problem... the report opens up with no ribbons and since I disabled the shortcut menu all the user can do is close the report, they are unable to change the margins, paper size, print, etc. I know that you can create a custom ribbon that allows the user to only use the basic tools. However, I do not want to overwrite the current Access Ribbon by changing the ribbon in the Access options. I would like to create a custom ribbon and on startup, depending on the access level it must open the appropriate ribbon, example if developer then normal access ribbon, if user then custom ribbon...



    I have now spent more than 36 hours with the report developing and becoming very frustrated, is there any recommended VBA tutorial specifically for Report Processing

    Thanks
    Earl

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    I disable the ribbon and shortcuts and have code that provides the users a custom button on Quick Access Toolbar for the print dialog. Check this thread http://forums.aspfree.com/microsoft-...at-303789.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48
    Hi June7,

    Thanks a mill for the thread... I also found additional resouce information on the same topic from the MSND website as (part 1 of 3, part 2 of 3 and part 3 of 3), but that was in depth code and looking at the thread you proposed was very helpfull.

    Could I request that you explain to me how to disable the the ribbons and shortcuts, below is my code where I disable everything when the user logs in:

    Private Sub Form_Open(Cancel As Integer)
    On Error GoTo Err_Form_Open
    DoCmd.SelectObject acTable, , True
    DoCmd.RunCommand acCmdWindowHide
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.ShowToolbar "Status Bar", acToolbarNo
    Call AccessTitleBar(False)

    Exit_Form_Open:
    Exit Sub

    Err_Form_Open:
    MsgBox "On Open ==> " & Err.Number & " - " & Err.Description
    Resume Exit_Form_Open

    End Sub

    Below is the coe for the module AccessTitleBar

    Option Compare Database
    Option Explicit
    Private Const GWL_STYLE = (-16)
    Private Const WS_CAPTION = &HC00000
    Private Const SWP_NOSIZE = &H1
    Private Const SWP_NOZORDER = &H4
    Public Const SWP_FRAMECHANGED = &H20
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, _
    ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, _
    ByVal nIndex As Long, _
    ByVal dwNewLong As Long) As Long
    Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
    ByVal hWndInsertAfter As Long, _
    ByVal X As Long, _
    ByVal Y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal wFlags As Long) As Long
    Function AccessTitleBar(Show As Boolean) As Long
    Dim hwnd As Long
    Dim nIndex As Long
    Dim dwNewLong As Long
    Dim dwLong As Long
    Dim wFlags As Long
    hwnd = hWndAccessApp
    nIndex = GWL_STYLE
    wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
    dwLong = GetWindowLong(hwnd, nIndex)
    If Show Then
    dwNewLong = (dwLong Or WS_CAPTION)
    Else
    dwNewLong = (dwLong And Not WS_CAPTION)
    End If
    Call SetWindowLong(hwnd, nIndex, dwNewLong)
    Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags)
    End Function

    Please check this code and advise whether I am doing it right or not. You input in the past week has really assisted me in leaps and bounds and gave me a better understanding of both access and vba.

    Thanks
    Earl

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    That code you are using is way outside my experience. I will let you tell me if it is right - does it run without error and accomplish what you want? The method I use is demonstrated by the sample project in that link I posted. I use project settings to disable the ribbon and shortcuts.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48
    The accessTitleBar function manipulates the system32 files by hiding access from the user, so that access does not appear on the forms when they open it up. I am busy trying your solution but I cannot seem to get the ribbon macro to run. When I click the Home buttin, the following error pops up:

    Access can't run the macro or callback function 'Ribbon.MarketingProjectsHome'
    make the macro or function exists and takes the correct parameters.

    I followed the links steps by step as follows:

    Created a Table USysRibbons with RibbonName (text) and RibbonXML (memo).
    In the RibbonXML I inserted the following code:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <tabs>
    <tab id="tabMain" label="Home">
    <group id="grpProjects" label="Projects">
    <button id="cmdHome" label="Home" onAction="Ribbon.MarketingProjectsHome" size="small"
    imageMso="OpenStartPage" supertip="Return to the Marketing Projects home page.
    Hold down the right shift key to open the database with full menus."/>
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>

    I then created the macro as per the link as follows:

    MacroName: MarketingProjectsHome
    Action: OpenForm
    Argumets: Marketing Projects Home,Form,,,Edit,

    Save the macro as Ribbon.

    Then closed the database and restart it and pressed the home tab and the error appears.

    Little lost now, because I following the steps and it did not give me the desired results.

    Help.... please
    Earl

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    I do remember it was a bit of a struggle to get the custom ribbon working. I did not use macros, VBA instead. Did you look at the sample project I posted in that link? I just now opened it after 2 years of not looking at it and ran fine. Hold the shift when it opens to get into design mode and you can explore the setup.

    Here is another project that has custom ribbon. Unzip the files to C: root and it should run properly (might have to set some VBA references in your app, such as MS Graph). Again, hold shift to suppress code execution and you can explore. http://www.box.net/shared/r8nea07sng
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    ETCallHome is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Limpopo, South Africa
    Posts
    48
    Hi June7,

    I tried downloading the other example, but it cannot create the destination file, i.e. in the previous download it asked me to unzip, here it does not even open, bu take me to the temp internet folder and when I try to open it the error appears.

    Earl

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,600
    I could download two of the files in the folder but not the frontend with code. I will have to work on replacing it. It shows application of the method from the first example and additional code for printing operation. Sorry about that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sizing and positioning
    By 161 in forum Database Design
    Replies: 1
    Last Post: 04-09-2011, 10:52 AM
  2. Default sizing query columns
    By 161 in forum Queries
    Replies: 0
    Last Post: 03-07-2011, 12:34 PM
  3. Access Form Sizing
    By AccessFreak in forum Forms
    Replies: 2
    Last Post: 12-31-2010, 11:56 AM
  4. Sizing Fields in Report Header
    By gutes2 in forum Reports
    Replies: 3
    Last Post: 03-05-2010, 01:17 PM
  5. Pictures sizing
    By newtoAccess in forum Access
    Replies: 0
    Last Post: 11-22-2009, 10:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums