Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123

    Wink What is the criteria for abstracting the first letter

    From other databases & queries where I used the First Letter, I tried copying & replacing the names accordingly, but it’s giving me lots of trouble. It’s telling me I have too many brackets.

    Here’s the criteria I’m trying to use: FirstLetter: Left$([Artists_Names_Similar_Artists_tbl.].[Artists_Names.],1))



    Any advice/suggestions would be greatly appreciated! Thanks in advance!

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    If this is in a query

    FirstLetter: Left$(Artists_Names,1)

    Assuming the field name is unique in the query, if not

    FirstLetter: Left$(Artists_Names_Similar_Artists_tbl.Artists_Names,1)

    You only need the square brackets if your table/field names have spaces or match a reserved word.


    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Minty has given you the correct syntax, but I'll point out that you do have mismatched parentheses: one opening and two closing. You also have dots inside the brackets. I assume...hope...you don't actually have dots in your table and field names.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    Thank you Minty for replying to my post. I tried your example & it's asking me to Enter a Parameter when I try running the query? I don't understand?/

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by djclinton15 View Post
    Thank you Minty for replying to my post. I tried your example & it's asking me to Enter a Parameter when I try running the query? I don't understand?/
    And the parameter is?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    I don't know. Never worked much with parameters.

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by djclinton15 View Post
    I don't know. Never worked much with parameters.
    Well it will give you the name of the parameter it is looking for?
    Generally occurs because someone cannot type correctly.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Dj one trick to find syntax on forms/fields is to open a query in design mode, go to any Criteria row box and right click and choose build, then go thru the options like select Forms, select your form (select the field) or if subform select that, then (select the field), and in the box at top, it will show you the syntax to access that field, usually you can just plug that in your code. Not sure if there is another way to do that.

  9. #9
    madpiet is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    154

    Like?

    Quote Originally Posted by djclinton15 View Post
    From other databases & queries where I used the First Letter, I tried copying & replacing the names accordingly, but it’s giving me lots of trouble. It’s telling me I have too many brackets.

    Here’s the criteria I’m trying to use: FirstLetter: Left$([Artists_Names_Similar_Artists_tbl.].[Artists_Names.],1))

    Any advice/suggestions would be greatly appreciated! Thanks in advance!
    SELECT ...
    FROM Mytable
    WHERE Artists_Names LIKE 'A%';

    (Maybe it's * instead of % in Access... honestly can't even remember.)

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by madpiet View Post
    SELECT ...
    FROM Mytable
    WHERE Artists_Names LIKE 'A%';

    (Maybe it's * instead of % in Access... honestly can't even remember.)
    You're correct, but unless I'm blind Like has not been mentioned or used in this thread.

    Edit: Never mind, I see you're offering an alternative. Sorry.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It is * in Access unless using ADO.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    FWIW:
    The default wildcard uses LIKE A* or if using ANSI-92 syntax ALIKE A%
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  13. #13
    djclinton15 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2015
    Posts
    123
    I want to thank everyone for their input; I do apprechiate their time. I've used the First Letter criteria (for lack of a better word) in many other queries/databases & never had such issues. I don't understand why I'm having so much trouble? I like when Minty told me exactly what to type & I don't understand why her suggestions didn't work. I know that it's going to look & sound really dumb on my part, but honestly I don't understand what everyone had suggested. Although, I might have worked with Access/databases for years your still dealing with an amature.

  14. #14
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Although, I might have worked with Access/databases for years your still dealing with an amature.
    Well we will try to not wind you up.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The name of the table and/or the field is spelled wrong.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. first letter capitalized
    By spvsandy in forum Forms
    Replies: 3
    Last Post: 04-20-2019, 03:11 PM
  2. Add 1 to a letter
    By Gina Maylone in forum Access
    Replies: 5
    Last Post: 03-14-2017, 08:20 PM
  3. Report as Letter
    By blue_echo in forum Reports
    Replies: 1
    Last Post: 04-13-2016, 02:11 PM
  4. Replies: 4
    Last Post: 09-18-2012, 05:07 AM
  5. From letter from a report
    By LANCE in forum Reports
    Replies: 4
    Last Post: 07-04-2009, 09:32 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