Results 1 to 8 of 8
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329

    left, Mid, Right

    Hi Guy's is there a reference in the library to check to add for functions Left( or Mid( or Right(

    When I type it in my code, the options don't come up when they usually do after entering the opening bracket ?

    Thanks in advanced

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    for references, I have :
    Ms Access v# Object library
    and VB for applications

    and they all show up.
    If you have any that say MISSING and are checked, then uncheck these, otherwise they give a false error.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    otherwise just google

    vba left function

    to find a site such as this one

    https://docs.microsoft.com/en-us/off.../left-function

    and on the left you will find all the other functions

  4. #4
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329
    Hi Guy's as always thank for your help, I have since tried using the Mid function on the next Sub down and it works, just won't work on this particular event, never come across this ??

    Although i have it listed in the code, I manually put commas in etc, the function didn't open when i opened the first bracket ????

    Code:
    Dim LiftBody As String, AddCost As String, LeftStr As String, MidStr As String, RightStr As String, mPrice As Currency
    Dim Pos As Integer
    
    
    If Me.tbxTooOld = True Then
    mPrice = DLookup("Charge", "tblReplies", "[Acorn] = Yes" & " And [Straight] = Yes" & " And [TooOld] = Yes")
    LiftBody = DLookup("MailBody", "tblReplies", "[Acorn] = Yes" & " And [Straight] = Yes" & " And [TooOld] = Yes")
    LeftStr = Left(LiftBody, 1, 155)
    AddCost = Mid(LiftBody, 156, 1)
    RightStr = Right(LiftBody, 1)
    Me.textLiftBody = LeftStr & ", " & mPrice & " " & RightStr
    End If

  5. #5
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329
    Hi Guy's in post 4, it's a strange one because the tick box wont even allow a " me. " as in me.tbx ??

    It is only on this tick box that the options are not appearing!!

  6. #6
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    Where is this stored ? In a module or in the forms module?
    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 ↓↓

  7. #7
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329
    Hi Minty, is is an event procedure on after update of a tick box on a form, it is looking in another another to see if the tick box is true

    The bizarre bit is that none of the functions are appearing in that event procedure whereas if i move to the next Private Sub on the same form, all options are there ie: me. left( Mid( etc...

    I think i have seen this before but unsure why, also done a compact and repair which didn't fix!!

  8. #8
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    Copy and paste your code to a text editor.
    Delete the sub.
    Compact and repair.

    Now recreate the empty sub for the event. Only put a comment or similar in it.
    Compact and repair again. Now try pasting your original code back into the event.
    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 ↓↓

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

Similar Threads

  1. Left Join
    By KoolKatelyn in forum Queries
    Replies: 4
    Last Post: 07-06-2016, 01:19 PM
  2. Left Help
    By jo15765 in forum Queries
    Replies: 4
    Last Post: 11-17-2014, 11:32 AM
  3. mid,left function
    By revned12 in forum Queries
    Replies: 2
    Last Post: 07-06-2012, 12:09 AM
  4. inner, left or right join ?
    By toqilula in forum Access
    Replies: 0
    Last Post: 04-11-2011, 12:20 AM
  5. Replies: 3
    Last Post: 02-02-2011, 01:00 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