I am using this in a query field:
BracketsRemoved: SwapStuff([BracketString])
The problem is that sometimes BracketString is empty, sometimes not.
Lee : )
Thanks for your reply Simon,
My module now looks like this:
Option Explicit
Function SwapStuff(myStr As String) As String
Dim strHolder As String
If Not IsEmpty(myStr) And Not IsNull(myStr) Then
If Len(myStr) > 0 Then
strHolder = Replace(myStr, "[", "")...
Hello,
I have a module that strips square brackets from any strings which may contain them. It works fine, unless the string passed into the function is empty, in which case the function returns '#Error'. I've tried to rewrite it to stop this from happening, but i'm new to Access and VBA so I...
Paul,
Just hit a snag - wonder if you could help with this? The code that you gave me is fine - unless the 'For' field in the table doesn't contain the word 'for'. In these situations your code cuts off the first 4 characters in the field.
Is it possible to sort this out with some kind of IIf...
Thanks Paul,
What you're suggesting seems fine, but i'm getting errors when I try to run it.
My module looks like this:
Option Explicit
Function SwapStuff(myStr As String) As String
Dim strHolder As String
strHolder = Replace(myStr, "[", "")
SwapStuff = Replace(strHolder...
Hi,
I'm having trouble with using 'Substitute' in my query.
I have a table containing two fields, 'Squares' and 'For'.
'Squares' contains text enclosed in square brackets, and I want to get rid of the square brackets but keep the rest of the string.
'For' sometimes contains the word 'for'...
I've managed to figure out why it wasn't working - I was typing the SQL into the criteria box instead of into the SQL view! So, everything is fine now : ) Thanks very much for your advice,
Lee.
Thanks for the tip Neal,
I've tried this, but when I try to run the query I get the following error message that I don't understand:
'You have written a subquery that can return more than one field without using the Exists reserved word in the main query's FROM clause. Revise the SELECT...
I am new to Access, so this may be easy to do, but it has got me stuck!
I have two fields in a table:
'FilmTitle' and 'Responsibility'
The 'Responsibility' field contains details about Film directors, producers, actors, etc.
What I need is that if the 'Responsibility' field for a record...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.