Results 1 to 5 of 5
  1. #1
    ylya is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2020
    Posts
    2

    Floating name and variable fields inside of a text


    I am trying to achieve to embed FirstName, LastName, Gender and Date fields from a query into a text as shown in the screenshot. As you know some names are short, some names are long. How can I embed these fields into template text in the report? Thanks

    Click image for larger version. 

Name:	screenshot.png 
Views:	17 
Size:	6.1 KB 
ID:	43344

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    in your text, replace 'John Brown' with something like {FirstLastName} and 'his' with {Gender} etc

    then in the report recordsource, use a calculation something like

    embedded:replace(replace([myTemplate],"{FirstLastName}",[FirstName] & " " & [LastName]),"{Gender}",[Gender])

    use curly brackets for the placeholders so they won't get confused with anything else

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    See this youtube video from Phillip Stiefel where he shows his function and example of what you are requesting. Very, very similar to ajax's advice.
    Last edited by orange; 10-31-2020 at 10:44 AM.

  4. #4
    ylya is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2020
    Posts
    2
    Quote Originally Posted by Ajax View Post
    in your text, replace 'John Brown' with something like {FirstLastName} and 'his' with {Gender} etc

    then in the report recordsource, use a calculation something like

    embedded:replace(replace([myTemplate],"{FirstLastName}",[FirstName] & " " & [LastName]),"{Gender}",[Gender])

    use curly brackets for the placeholders so they won't get confused with anything else

    I recently started learning Access and this is my first attemtp to create a database with access. Where to add calculations? Could you please elaborate?

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Where to add calculations?
    in your query

    if you want, provide details of your tables and relationships and I can provide a more focused answer

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

Similar Threads

  1. Formula and Text inside a Text box
    By trident in forum Forms
    Replies: 1
    Last Post: 04-18-2015, 02:38 AM
  2. Text inside an unbound
    By Ruegen in forum Forms
    Replies: 3
    Last Post: 08-22-2013, 10:17 PM
  3. Floating Text Box
    By glasgowlad1999 in forum Forms
    Replies: 1
    Last Post: 02-02-2011, 12:10 PM
  4. How to vertically align text inside a text box ?
    By alexcalgary in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 08:44 AM
  5. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM

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