I need this formula translated:
=RIGHT($D4,LEN($D4)-FIND("@ ",$D4,1))
Thanks
I need this formula translated:
=RIGHT($D4,LEN($D4)-FIND("@ ",$D4,1))
Thanks
Not enough info. And my crystal ball is in the shop... don't know why they can't fix it!!
What are you trying to do? Use lots of words.
What is your table structure?
Remember:
No one can see your dB
No one knows what the data looks like
No one knows what the result should be....
Try this:
Code:Public Function GetDomainFromEmail(strEmailAddress As String) As String Dim intLen As Integer Dim strOutput As String intLen = Len(strEmailAddress) strOutput = Right$(strEmailAddress, intLen - InStr$(1, strEmailAddress, "@")) GetDomainFromEmail = strOutput End Function
@hansendl... Nice read.
It was a long day
I modified your function:
Use in a query:Code:Public Function GetEmailDomain(strEmailAddress As String) As String GetEmailDomain = Mid(strEmailAddress, InStrRev(strEmailAddress, "@") + 1) End Function
E_Domain: GetEmailDomain(NZ(Email,""))
where EMail is the field in a table. The NZ() function is there just in case of null email address
The VBA is not even necessary unless you want this procedure to be available from multiple locations.
Can calculate in query or textbox.
Mid([fieldname], InStrRev(Nz([fieldname],""), "@") + 1)
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Doh!!!
Sometimes I get so wrapped up in using VBA, I forget the obvious.
@ssanfu...even better. I got so caught up in duplicating the Excel function as written that I didn't even think about Mid. @June7...nice!
r/
Dean
Thank you for all the replies.
Here's what I have:
John Smith @ 1234 N Main Ave Los Angeles CA 90001-1234
I need a field that shows only 1234 N Main Ave Los Angeles CA 90001-1234.
Thanks
Did you try the suggestions? Another variation:
Trim(Mid([fieldname], InStr(Nz([fieldname],""), "@") + 1))
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
These formulas did not work. I changed fieldname to the proper field name. The query was blank.
I need this:
John Smith @ 1234 N Main Ave Los Angeles CA 90001-1234
Queried into this:
1234 N Main Ave Los Angeles CA 90001-1234.
Thanks
Don't know why it didn't return any values. Works perfectly for me. Would have to see your dB.
Open Query1.....
I see what I did wrong.
I put the formula in the criteria field.
I put the formula in the proper field and now it works.
Thanks
Great.
Ready to mark this solved?
No.
I need this:
1234 N Main Ave Los Angeles CA 90001-1234.
to show up in the field next to this:
John Smith @ 1234 N Main Ave Los Angeles CA 90001-1234
but I need it done in the form (rather than / as well as) the query.
Thanks
If it is in the query for the form, it is available to add to the form.
You do have a query as the record source for the form, right?
Or am I misunderstanding?