Results 1 to 3 of 3
  1. #1
    Phoenixenv is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Location
    Perth, WA
    Posts
    8

    Can I format a field used in a Calculated field

    Hi everyone,


    i have just spent hours trying trying to work out if i can Format a field(s) on the way into a Calculated field.

    I want a calculated field for flora/fauna species names that is formatted correctly for use in reports, but i dont always need it formatted the way it is in a report, for example:
    Dictyota friabilis is fine when just working up drafts, calculating number etc, but when presenting a species list in a report for example, each name must be formatted like this: Dictyota friabilis

    However it gets slightly complicated with informal species names such as: Peplidium sp. Tanami (P.K. Latz 11904), notice that the Genus name is italicized and the species names is not in this case.I have a field that tells me that "sp. Tanami (P.K. Latz 11904)" is informal so i can use an IIF statement to ensure that informal species names are not italicized.

    Although i haven't tried yet, i am sure i could easily get the result i want using a control in a form/report, but these are large datasets, and often i just want to grab the data from a query, all my staff find it easier that using reports, plus i would have to create dozens of reports based on those queries, so i would prefer to simply use a calculated field that takes 'Genus' and italicises it, then formal species names and italicses them, leaving informal species names un-italicized.

    I have tried creating a calculated field, setting it to Rich text and using html tages: <I>Genus</I> for example, but with no luck.

    Can anyone help? Is this possible?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in the query, select the the calculated field,
    format box will show in properties

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    plus i would have to create dozens of reports based on those queries,
    No, not necessarily. You can always open a report using Docmd.OpenReport with a "WHERE" to select which records are displayed. You can also change the record source of the report "on-the-fly" if you need to.

    Another option would be to create a "search" form which sets the parameters for the records to be displayed, then displays the list in a subform formatted as a continuous form or datasheet. Conditional formatting on the species field can be used to get the results you are looking for.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-03-2016, 06:54 PM
  2. Replies: 6
    Last Post: 06-26-2015, 08:55 PM
  3. Replies: 2
    Last Post: 12-30-2014, 01:32 PM
  4. Format numbers for a calculated field in a query?
    By Access_Novice in forum Queries
    Replies: 2
    Last Post: 10-25-2014, 03:56 PM
  5. Replies: 1
    Last Post: 04-21-2013, 03:20 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