Can you help me write a simple code?

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
 
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!
 
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 :):):):)
 
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'
 
That explains why I hadn't seen it then ....:D
 

Users who are viewing this thread

Back
Top Bottom