Results 1 to 5 of 5
  1. #1
    ceb39usa is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2013
    Location
    San Francisco
    Posts
    8

    Question Centering text on a form?

    I am in the process of producing name badges on an Avery 74536 badge form. These form are 3"x4".



    At the top of the form I have some text which indicates what the badge is for. In this case it is for a class reuion. Below it is a picture of the person attending the class reunion. Both item are centered and come out the way I want them.

    Below the photo is the name of the person. This consist of two text boxes for the first and last name. It is printing the way I intended it to print, and align the First Name text to the right, and the Last Name text to the left so both are spaced properly.

    Some of the people who reviewed this badge said it was good, BUT the names on some badges were more to the right than others. The problem is, when a man named Jim has a nine letter last name the whole name prints out on the badge and it is sort of looks shifted to the right. For my name which has five letters in the first name and seven letters in the last name, looks good as it appears to be pretty close to centered on the photo above it.

    This problem is going to be more compounded when I have to print out badges for female graduates and have to include their maiden name between their first and last name.

    Anybody have any ideas on how to solve this problem?

    Some body is going to suggest using the Report Label function in Access. It works great. I gave it a try. It worked great. The spacing problem I am having now went away, and adjustment for placing a female graduates maiden name between their first and last name came out looking great. Only one slight problem. The photo associated with the graduate does not print on the badge when using the Label function. Do not know what the problem is with that, but if there is a solution, this whole task would be solved.

    If companies can make ID badges with text and pictures on them, there has to be a solution some where.

    Thank your for your help.

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    How about concatenating the first and last names and putting them in a single textbox with alignment centered?

  3. #3
    ceb39usa is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2013
    Location
    San Francisco
    Posts
    8
    Quote Originally Posted by davegri View Post
    How about concatenating the first and last names and putting them in a single textbox with alignment centered?

    Good idea, but you do not have enough fingers and toes times 2 to count the years since I have done any coding. Any suggestions? Neither of the two Access books I have go into detail about this.

    When I create a report and used the Label function a line of code is produce which formated the names well (although I am not certain about the centering).

    What is good about this is does not matter whether the name is male or female. The results are good.

    The code looks like this:

    =Trim([FirstName] & " " & [MaidenName] & " " & [LastName])

    Tried cutting and pasting this into my report (the badge) but it did not work. Too bad as the photo was in mine report.

    Thanks

    ceb39

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Tried cutting and pasting this into my report (the badge) but it did not work. Too bad as the photo was in mine report.
    Where did you put the expression?
    Try:
    Code:
    YourTextboxName = Trim([FirstName] & " " & [MaidenName] & " " & [LastName])

    in the On Format event of the reports Detail section.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    This is being done on a report? The easiest might be to
    - hide the fname and lname controls (textboxes on report that hold first and last names),
    - create a new textbox and remove its label,
    - center it under the picture control
    - make its control source = 1stInvisibleTextbox & " " & 2ndInvisibleTextbox
    - and while still in design view on the report, go to the property sheet and set the control text alignment property to be centered.

    As long as the picture will always be centered in its control, all should be fine.
    Also possible to concatenate the field names into one textbox and eliminate the other two, but I'm considering the comment re experience when making the above suggestion.
    Or would the format event be necessary because this is a multi line sheet of labels?
    Last edited by Micron; 09-17-2018 at 08:36 AM. Reason: added questions
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-01-2018, 04:20 PM
  2. Replies: 1
    Last Post: 11-11-2016, 08:22 AM
  3. Centering an BMP in a report
    By kroll73 in forum Reports
    Replies: 2
    Last Post: 04-16-2014, 10:50 PM
  4. Centering a Form within the Monitor screen
    By ashim in forum Programming
    Replies: 2
    Last Post: 04-13-2014, 02:20 PM
  5. Vertical centering in a Label field?
    By newtoAccess in forum Access
    Replies: 1
    Last Post: 11-07-2010, 11:01 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