Replace (1 Viewer)

Gismo

Registered User.
Local time
Today, 14:04
Joined
Jun 12, 2017
Messages
1,298
Hi all,

Please could you advise in any annunciation in the below code

Replace could be the problem here

SB #: [SB/AD Master]![Aircraft Type] & "/" & [SB/AD Master]![MI Type] & "/" & Replace ( [SB/AD No] , '-' , '/' ) & "/R" & [Revision Status]

I am getting a visual basic module containing a syntax error, compile error
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:04
Joined
Sep 21, 2011
Messages
14,304
Why not take it small steps, one at a time?
You could Debug.Print that in the immediate window?

Perhaps it is your awful naming convention? Surround SB # with [ and ] ?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:04
Joined
Feb 28, 2001
Messages
27,186
Yep, I'm with Gasman here - special characters in variable names are sure tripping points.

Syntactically, everything to the RIGHT of the colon looks compilable, but you might wish to check for any of those bracketed items being null.
 

Gismo

Registered User.
Local time
Today, 14:04
Joined
Jun 12, 2017
Messages
1,298
Still getting the same error after breaking down the code
Replace seems to be giving a compile error

[SB #]: Replace([SB/AD Master],"-"," /")
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:04
Joined
Sep 21, 2011
Messages
14,304
Just where is this code?
It appears to be a query alias field from what you have written?

AFAIK, that does not generate compile errors?
 

Gismo

Registered User.
Local time
Today, 14:04
Joined
Jun 12, 2017
Messages
1,298
Just where is this code?
It appears to be a query alias field from what you have written?

AFAIK, that does not generate compile errors?
Yes, this is a query

1687348362611.png
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:04
Joined
Sep 21, 2011
Messages
14,304
You don't have you own Replace function do you? :(
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:04
Joined
Sep 21, 2011
Messages
14,304
Works for me
1687349136103.png

so out of ideas, sorry.
 

Gismo

Registered User.
Local time
Today, 14:04
Joined
Jun 12, 2017
Messages
1,298
Works for me
View attachment 108496
so out of ideas, sorry.
I had some issues yesterday where excel and word wont open
IT reinstalled my office suite, I believe from 32bit to 64bit
There after word and excel opened but non of the functions calculates
This code in Access word fine for the past 2 year and after the update i am getting quite a few issues
This is one of the issues I have after the update or reinstall rather
 

Gismo

Registered User.
Local time
Today, 14:04
Joined
Jun 12, 2017
Messages
1,298
Confused- you also say


Which is it?

Check your references in vba, perhaps you are missing one or more
Excel and word was having issues not opening
after the reinstall, excel wont calculate a basic function

The query was for Access
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:04
Joined
Sep 21, 2011
Messages
14,304
Get your IT dept involved then.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:04
Joined
Feb 19, 2013
Messages
16,613
So still no clearer - could be access vba, could be a query and now it is excel functions. So agree with gasman, talk to your IT dept
 

Users who are viewing this thread

Top Bottom