Results 1 to 5 of 5
  1. #1
    sdmecsmllc is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2022
    Posts
    1

    Can you conditionally vertically center merge a report cell that is grouped?


    I've created a report in Access that produces company name and email addresses, with blank company name when multiple emails are present. I can't figure out how I can merge and center the cells in the company name column. Is it possible? With a report or a spreadsheet output?





    Acme Inc email1@email.com
    Vinny's company emailxyz@email.com
    email999@email.com
    Great Big Mega company emailxxx@email.com
    info@gmail.com
    support@hotmail.com












    I want it to look like this:


    Can this be done with conditional formatting in access or Excel?

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Here is some info for doing it in Excel:https://www.mrexcel.com/board/thread...nwards.942431/

    For Access you should move the company name to the group headerand leave the emails in the detail section.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Access doesn't have "cells" per se; not in tables, forms, reports or queries. I think the best you can do in Access in a report is to use grouping as Gicu alluded to.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    the horizontal centring is simple enough - just set the customer control property to centre text. For vertical centring you could try the following

    1. create a separate report for emails
    2. drag this into the detail section as a subreport and ensure cangrow/shrink is set and linkchild/master properties are set
    3. in the detail on format event use code to adjust the top value for the customer control - something like

    customercontrolname.top=(subreportname.height-customercontrolname.height)/2

    I don't have time to experiment, but it may be the subreport has not resized when the format event runs in which case you could try getting the recordcount for the subreport and multiplying that the subreport detail section height - somehting like

    customercontrolname.top=((subreportname.report.sec tion(acDetail).height*dcount("*","nameofEmailTable ","CustomerFK=" & customerPK))-customercontrolname.height)/2

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    had a play around with my suggestion and came up with this (excuse the data, just used something that came to hand) which works in print preview
    Click image for larger version. 

Name:	image_2022-02-02_200946.png 
Views:	11 
Size:	14.0 KB 
ID:	47221

    It follows my second suggestion since the 'grow' event occurs after the format event
    Code:
    customercontrolname.top=((subreportname.report.section(acDetail).height*dcount("*","nameofEmailTable","CustomerFK=" & customerPK))-customercontrolname.height)/2
    the trick is you need to size the subreport tall enough that when customercontrolname's top is assigned, it will still be above the bottom of the subreport otherwise the grow event will move the control down further
    Last edited by CJ_London; 02-02-2022 at 04:36 PM.

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

Similar Threads

  1. Center text vertically
    By kuku202 in forum Reports
    Replies: 1
    Last Post: 02-07-2015, 05:27 AM
  2. Replies: 3
    Last Post: 02-17-2013, 09:20 PM
  3. Replies: 7
    Last Post: 10-18-2012, 12:49 PM
  4. Vertically Dynamic Report
    By chris.williams in forum Reports
    Replies: 1
    Last Post: 09-05-2012, 08:11 PM
  5. Center Form Vertically
    By injanib in forum Forms
    Replies: 5
    Last Post: 03-24-2011, 01:51 PM

Tags for this Thread

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