Extracting Middle Initial From Text String
Dec 21, 2005
Hello,
Is there an easy way to split a full name into firstname, middle name and lastname? I have a field name with names such as James R Lowes and i would like to split the name in 3 like.
Firstname : James
Middle Initial: R
Lastname: Lowes
I was able to find a module to extract the first name from a string, but don't know much about VB and cannot figure out to do the rest.
Please help!
thanks,
Pablo
View Replies
ADVERTISEMENT
Dec 21, 2005
Hello,
Is there an easy way to split a full name into firstname, middle name and lastname? I have a field name with names such as James R Lowes and i would like to split the name in 3 like.
Firstname : James
Middle Initial: R
Lastname: Lowes
I was able to find a module to extract the first name from a string, but don't know much about VB and cannot figure out to do the rest.
Please help!
thanks,
Pablo
View 5 Replies
View Related
Mar 2, 2006
Dear All:
I have a database with ID_Number, Last_Name, First_Name and Middle_initial. This database has 500 records.
The Middle_initial field is populated with a letter. I wish to add a period "." after each letter in the Middle_initial field only.
Any ideas on how to use an update query to accomplish this?
Thanking in advance.
Dion
View 2 Replies
View Related
Nov 15, 2005
I need to be able to extract individual fields from a table as strings in order to then send this data to my EPOS printer (which will accept only strings to print) I have created the table with a query so the question could equally be how can i output strings as query results. Im using Access97 HELP!!
I have tried to set up a ADODB.Connection but either Access 97 wont accept it or i've got the coding wrong
View 3 Replies
View Related
Dec 13, 2012
I have names which are in the following format
smith, john adam
smith jr, john adam
smith, john a
smith, john
How can I make all middle names middle initial IE
smith, john a.
smith jr, john a.
smith, john a.
smith, john
I would imagine I need to use instrrev and insert "*." after the last space. Would that work?
View 2 Replies
View Related
Mar 5, 2015
I have a flat file sent to me today that contains a number of fields with the same issue. As an example, I have a field named Coordinators from a table named Audit and the data within it is formatted as follows:
Mark Hollings;#14664;#Judy Thompson;#10169;#Tammy Wilson;#3608;#Tim Levy;#2785;#David Simpson;#1251
Is there any way to extract only the names while leaving in either the ";" or replacing it with a ","? My desired output would look like this:
Mark Hollings;Judy Thompson;Tammy Wilson;Tim Levy;David Simpson
This field can be populated with one or more names so that's a variable in all of this as well.
View 3 Replies
View Related
Dec 21, 2012
I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.
If Me.PaNumber = "*D" Then
Me.txtMaxOrdLimit.Visible = True
Else
Me.txtMaxOrdLimit.Visible = False
End If
View 3 Replies
View Related
Oct 25, 2006
Hey Guys,
I've got a field called [WordLink] on a form where the user enters the file name of the Word or Excel document asociated with the record.
I have a button that opens Word or Excel and then opens the file...not a problem there as I'm using the Call Shell("""C:Program Files command and that works just fine.
However, I need the button to look to see if it's got ".doc" or ".xls" within the text string in the field so it knows whether to open Word or Excel.
I've tried something basic to launch something like a msgbox (see code below) but obviously it doesn't work. How do I look within a text string for a value?
Cheers,
Russ
:D
If Me.WordLink_filename.Value = "*.doc" Then
MsgBox "This is a word file."
Else
End If
View 2 Replies
View Related
Feb 7, 2005
What is the VBA code for this:
VariableName = Select Table1.Field2 From Table1 Where Table1.Field1 = "TextValue"
I would like to set the VariableName to the value of field2 where field1 is equal to a text string.
Thank you for taking the time to review and answer this for me.
Marty
View 5 Replies
View Related
Apr 25, 2006
I have created a report that has string text from a query I created. The query, with the string text, take the information from a table. When I run the report the string text gets cut off (The box is big enough to hold the information). The table I have is a linked table to a text file that gets imported from a program. I try creating the same table but not having it linked and the string text worked.
Is there some way I can get around this? Is there something in the linked table that is stoping the string text?
View 14 Replies
View Related
Sep 21, 2005
Access 2000. I have table of many hundreds of records. One of th fields of text looks like this: XXXXXXXXXXXX and I want it to look like this: XXX XXX XXX XXX by adding the spaces. Would someone please show me how to write the function or code to add the spaces to the text as shown : Thanks :o
View 3 Replies
View Related
Aug 7, 2005
First of all I'm not very good with VB. What I'm trying to do is get all my customers email addresses in one text string. So it would go like 123@aol.com; bob@yahoo.com; fred@hotmail.com; and etc. My customer could then copy it and paste it in her TO: box of her email server. Any help would be great.
View 6 Replies
View Related
Aug 21, 2014
I have a text field with receipt numbers in the format 0001-00000### and I would like my data entry form to default the max existing value + 1.
If max value is 0001-00000201, then the new record should suggest 0001-00000202.
The problem is that if I use the "max" function, it does not work (I think because that function is intended for numbers, not text strings).
Table: RECEIPTS
Field: receiptnum
I also have a query with just one field that lists only the receiptnum unique values so that I can use them in comboboxes in other forms... it may be useful I guess...
Query: unique-receiptnum
Field name: receiptnum
View 4 Replies
View Related
Mar 7, 2006
How do i trim a name in a string.
I have 2 rows with firstname in one and the second has surname. if i wanted to view the results to have A Einstein rather than Albert Einstein, how would this be done?
thanks.
View 1 Replies
View Related
Feb 13, 2008
I have a list if names, some with a middle initial and some without, that are all in one field. eg George P Wingrove or Ada Wingrove. Can I run a query that will seperate the name into two or three fields? I have tried the following in a query, but not being very successful. FirstName:Left([Name],InStr(1,[Name]," ")-1), MiddleInitialTrim(Mid([Name],InStr(1,[Name]," ")+1,InStr(InStr (1, [Name], " ")+1,[Name]," ")-InStr(1,[Name]," "))) and LastName:IIf(InStr(InStr([Name]," ")+1,[Names]," ") <>0, Right([name],Len([name])-InStr(InStr([Name]," ")+1,[Name]," ")),Right([Name],Len([Name])-InStr([Name]," ")))
Unfortunately, it puts #Error if there is no middle initial. Any way round this problem?
David
View 5 Replies
View Related
May 23, 2006
Dear All,
Thank you for taking the time to look at this Question.
I am using a form in which i only need the last sections.
example:-
G/001 - Ceiling - Tiles - Perforated. this is what i get at the second, but i would like to drop the "G/001 - " and just have "Ceiling - Tiles - Perforated.", has anybody got any ideas on how to do this please.
View 1 Replies
View Related
Oct 6, 2006
looked around but could not find the answer.
i have a text box that might or might not contain text and number data. an example of the data in the text box might be;
bob roberts, 17/03/2006, aged 23
what i would like is some VB code that would:
check anywhere in the text box for number characters that are 8 characters in length with a comma at the end [12345678,] as in the first example. and change this to 12/34/5678,
bob roberts, 17032006, aged 23
would become 'on lost focus'
bob roberts, 17/03/2006, aged 23
anybody any idea how to do this?
thanks
View 2 Replies
View Related
Oct 19, 2006
hi
I'm no expert and can't seem to find what i'm looking for.
i have data i enter into a text box. the data might be in the format
"name"
OR
"name, date, age"
OR
"name, date"
if on the second or third example above i entered the data like shown below how would i VB code the afterupdate to do this:
turn
David Roberts, 12122006
to
David Roberts, 12/12/2006
OR turn
David Roberts, 12122006, 56
to
David Roberts, 12/12/2006, aged 56
any ideas??
I'm working along the lines of instr, mid, etc. but i'm not sure of the correct procedure
thanks in advance
View 5 Replies
View Related
Apr 2, 2015
I have a text field in a Table and on a Query called "Notes" In that field that has data like below:
[04/02/2015:BD] Project is to be assessed by Solutions Planning
[03/27/2015:BD] Project prioritized
[03/14/15:BR] Entered to system
Im trying to find a way to pull just the most recent line of text, in this case
[04/02/2015:BD] Project is to be assessed by Solutions Planning
into the field next to "Notes" or wherever - an empty field in the query. I searched around, found some stuff and I was thinking of having the code look at the first "[" and count the length to the next "[" and pull out whats in between. Looks like the bracket causes issues in the module.
View 10 Replies
View Related
Mar 18, 2015
I have a string that includes mm/dd/yyyy + person's name. All of this is concatenated and is recognized as a text value. Then I want to convert all of these characters to a number. Since each character has an ASCII code, I would like to find ASCII equivalent.
In Excel, this would involve using something like the CODE ( ) function, but that only gives the numerical equivalent for the first character in the string, but I want all characters at once.
When I try the VAL ( ) function, it returns the first character which is the number of the month.
View 4 Replies
View Related
Sep 21, 2005
I have a multi-select list box that runs a "For intCounter" and builds a sting into a text box. That works fine the text box will populate as designed <"Closed" OR "On-Going">.
(I know that I should be dynamically creating the query in the first place ... normally I would ... but this is a quick fix that I want to get it into an existing application, while the redesign requirements are being written.)
Now I want to pass that string to a pre-existing query, but I'm not sure what to write in the criteria section.
I've tried...
Like "*" & [Forms]![ViewReports]![TextPickList] & "*"
IIf([Forms]![ViewReports]![TextPickList]="","",[Forms]![ViewReports]![TextPickList])
and just plain old ...
[Forms]![ViewReports]![TextPickList]
but my query is coming up blank. What do I need to write into the criteria section of this saved query?
thanks in advance!
View 2 Replies
View Related
Feb 2, 2006
Hi there,
I have to format a date following dd-mmm-yy in an expression also containing text.
Expr1: "Text" & " " Date()
Although separately formatting the date is easily done. I need to keep both int he same expression.
View 3 Replies
View Related
Nov 23, 2014
I have a column containing records of the timestamp of an event. I need to extract the date out of each of these records and put them in a separate table. The date and time of each record is contained within a bracket.
E.g.
ES~1~1412179200(Oct 02 00:00:00 2014)~1~ITM_W64MQMONITORLOG00~
0~0~ES~1~1412179203(Oct 02 00:00:03 2014)~1~ITM_Log_Entries~
0~0~ES~1~1412179204(Oct 02 00:00:04 2014)~1~ITM_Log_Entries~
As you can see, the number of characters of each record are different, so I am unable to do the Left$ count thingy.
Is there any other way to do it? I only need the date and time contained in the brackets.
View 2 Replies
View Related
Mar 24, 2014
In my query, I have the week number and year arranged like this - "Y14-W11"
I want to return a value in a text box on a report if the string contains, for example, W11. In this textbox I've put the expression
Code:
=IIf([Y##-W##]="*" & "W11" & "*","2100000","BLAH")
But this just returns the falsepart no matter if the string contains W11 or not.
View 3 Replies
View Related
Feb 12, 2013
"Att Mr/Mrs Vezi Your DEFAULTED account has been handed over to XXX. Payment DUE IMMEDIATELY Ref 1315519509. Tel 0009377500"
I need to extract the word "Ref " plus the number that follows it from the above string. The problem is that the word "Ref " is not always in the same place and the number following it is not always the same length. (ie it could look like "Ref 123456 " or "Ref 1234567 ") The only commonality between the records is that the number will always follow the word "Ref ".
View 1 Replies
View Related
Apr 17, 2014
I'm working with a table of financial transactions. I need to know the date a record relating to cash received actually arrived in our bank, but the software doesn't allow the user to enter this, so I've asked them to enter it into a text reference field, e.g. 'Other Text XX 16/04/14', and then I've got a formula - CDate(Right(Trim([RefField]),8)) - which takes the date from this reference.
This works fine, but it's really important I don't miss any of these records due to the date not being entered, so what I'm trying to make is a formula which will give me the date from the ref field as in the formula above if there is one, but if that formula gives an error (so the date has been missed out or incorrectly entered) then I want to take the date from another field, called [DateAdded] as a failsafe.
I can't work out a formula that won't give me an error, i've tried loads. First I tried :
iif(iserror(CDate(Right(Trim([RefField]),8))),[DateAdded],CDate(Right(Trim([RefField]),8)))
But that gives an error, and I think from looking at forums that Access evaluates both parts of an Iif function so it'll do that.
It seems like other people are saying that you need to use Nz, IsDate or IsNumeric or something along those lines instead of IsError to evaluate the field, but I can't get that to work as it's not a field, it's a portion of a text field.
This is my latest attempt:
Join Date: IIf(IsDate(Right(Trim([RefField]),8)),[DateAdded],[Calc Date]),
where [Calc Date] is an expression field with CDate(Right(Trim([RefField]),8)) in it, but there's the #Error again.
How can I use iif to pick either a date from a text string, or where that results in an error then another date field?
View 9 Replies
View Related