Results 1 to 3 of 3
  1. #1
    JoaoSousa is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    13

    Shell Question - connecting to a path that is present on the form.

    Hi,

    How do I build a Shell function where the path is present on a text box of the form (it gets the value from a QRY)?
    Example
    1 form with multiple entries, each entry with its own command button with the shell cmd, each entry with its own path to the file.

    I want the button to open the path that is present on the text box that is on the form.
    The text box is called PathCZItxt.
    I know that the path is correct, as if I write it on the shell cmd it will open it without any problem.
    Shell "C:\Program Files\...\....\....\....exe PATH ON THE SQUARE THING OF THE FORM", vbNormalFocus
    I tried me.PathCZItxt.value; me.PathCZItxt.text; among other things...

    The path has spaces in it, example of the path to the file:
    R:\StudyYear\Shared\Scans\Stainings\Study Scanning\Quality\111111\111111-1 Sample 1
    I managed to concatenate everything on a QRY so that it gets all the paths for all samples by having a standard naming (more that 1000 paths)



    (New user of access with no IT background, just a passion for IT and loads of time to watch youtube to improve the database we're building)

    Any guidance?
    Kind regards

  2. #2
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    If the path has spaces in it then you will need to surround the path with quotation marks.

    Try this:
    Code:
    Shell """" & Me.PathCZItxt & """", vbNormalFocus

  3. #3
    JoaoSousa is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2020
    Posts
    13
    It worked!
    I didn't know I had to put the & & bit!

    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 06-27-2018, 01:33 PM
  2. Replies: 3
    Last Post: 09-20-2017, 06:54 PM
  3. UNC Path Error when running Shell
    By AccessPower in forum Programming
    Replies: 4
    Last Post: 01-20-2017, 03:47 PM
  4. Replies: 5
    Last Post: 05-09-2014, 02:38 PM
  5. Replies: 4
    Last Post: 05-20-2010, 03:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums