Can you help me write a simple code? (1 Viewer)

rgwood86

Registered User.
Local time
Today, 20:40
Joined
May 5, 2017
Messages
24
Nearly there!!!

Ok, so the below code works perfectly other than I still get the error message appear, but at least it does open the test database and closes the one I started the code in. Is there a way of removing this error message?

The error message only appears once and fills the screen which is a little unusual
 

isladogs

MVP / VIP
Local time
Today, 20:40
Joined
Jan 14, 2017
Messages
18,209
In future, add a debug line:
Code:
Debug.Print strPath & "\" & strName
Run the code and check the output in the VBE immediate window is what it should be

Anyway, to solve the issue with the spaces, add two more quotes changing the line to:
Code:
Call Shell("msaccess.exe "[COLOR="Red"][B]""[/B][/COLOR] & strPath & "\" & strName, vbMaximizedFocus)

or better still remove spaces from folder & file names!
 

rgwood86

Registered User.
Local time
Today, 20:40
Joined
May 5, 2017
Messages
24
In future, add a debug line:
Code:
Debug.Print strPath & "\" & strName
Run the code and check the output in the VBE immediate window is what it should be

Anyway, to solve the issue with the spaces, add two more quotes changing the line to:
Code:
Call Shell("msaccess.exe "[COLOR=red][B]""[/B][/COLOR] & strPath & "\" & strName, vbMaximizedFocus)
or better still remove spaces from folder & file names!

Colin...... I could kiss you right now!!!

Thanks again :):):):)
 

isladogs

MVP / VIP
Local time
Today, 20:40
Joined
Jan 14, 2017
Messages
18,209
Thankfully I'm a safe distance away :D

EDIT Many thanks for the kind reputation comment. For future info, points aren't awarded unless you also tick 'I approve'
 

isladogs

MVP / VIP
Local time
Today, 20:40
Joined
Jan 14, 2017
Messages
18,209
That explains why I hadn't seen it then ....:D
 

Users who are viewing this thread

Top Bottom