If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Return Left Portion of a String
Returning the left portion of a string in a query.
i.e. if the string is: " What combination of functions would return only "anybody" or any number of characters on the left side of the string before the @ character? |
#2
|
|||
|
|||
Return Left Portion of a String
"Bonnie" wrote in message
... Returning the left portion of a string in a query. i.e. if the string is: " What combination of functions would return only "anybody" or any number of characters on the left side of the string before the @ character? Left([YourField], InStr(1, [YourField], "@") - 1) -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
Return Left Portion of a String
Try something like . . . not tested
Sub GETSTRING() TempStr = "" MyString = Trim(Forms!form1!txtBox1.Value) For i = 1 To (Len(MyString)) If Mid(MyString, i, 1) = "@" Then TempStr = TempStr & Mid(MyString, i, 1) End If Next End sub HTH "Bonnie" wrote in message ... Returning the left portion of a string in a query. i.e. if the string is: " What combination of functions would return only "anybody" or any number of characters on the left side of the string before the @ character? |
#4
|
|||
|
|||
Return Left Portion of a String
Ignore the last post!
Try this instead Sub GETSTRING2() MyString = " TempStr = Left$(MyString, (InStr(1, MyString, "@", 0) - 1)) Debug.Print TempStr End Sub HTH "Newbie" wrote in message ... Try something like . . . not tested Sub GETSTRING() TempStr = "" MyString = Trim(Forms!form1!txtBox1.Value) For i = 1 To (Len(MyString)) If Mid(MyString, i, 1) = "@" Then TempStr = TempStr & Mid(MyString, i, 1) End If Next End sub HTH "Bonnie" wrote in message ... Returning the left portion of a string in a query. i.e. if the string is: " What combination of functions would return only "anybody" or any number of characters on the left side of the string before the @ character? |
Thread Tools | |
Display Modes | |
|
|