UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Create Shortcut For The Current Access Database?, Access 2010    
 
   
Sami
post Jul 16 2019, 01:14 PM
Post#1



Posts: 49
Joined: 3-April 19



Hi, I am looking for a vba code that can make shortcut for current access data base.
Thanks in advance.
Go to the top of the page
 
theDBguy
post Jul 16 2019, 01:28 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,078
Joined: 19-June 07
From: SunnySandyEggo


Hi. Could you please elaborate a little bit? Is this what you mean?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Sami
post Jul 16 2019, 02:15 PM
Post#3



Posts: 49
Joined: 3-April 19



Hi . I didn't know how to use the code in the link.
I want to make shortcut to my access data base and then send it to the start up folder
If the program moved to another computer.
I have found the way to move the shortcut but I didn't find how to creat the shortcut automatically yet.
Thanks again
Go to the top of the page
 
Sami
post Jul 16 2019, 03:22 PM
Post#4



Posts: 49
Joined: 3-April 19



thanks i get what i need and edit the original code to work every where not only in static path
CODE
Sub CreateShortcut3()
'121123, Crystal, strive4peace
' for early binding -- needs reference to Windows Script Host Object Module
'this code uses late binding so no reference is necessary

   On Error GoTo Proc_Err
   Dim oWsh As Object _
      , oShortcut As Object
      
   Dim sPathDesktop As String _
      , sShortcut As String _
      , sPathFile As String
  
   sPathFile = CurrentProject.Path & "\" & Application.CurrentProject.Name
  
   Set oWsh = CreateObject("WScript.Shell")
   sPathDesktop = oWsh.SpecialFolders("Desktop")
   sShortcut = sPathDesktop & "\" & Application.CurrentProject.Name & ".lnk"
  
   Set oShortcut = oWsh.CreateShortcut(sShortcut)
   With oShortcut
      .TargetPath = sPathFile
'      .Description = "Description of my icon"
'      .RelativePath = "c:\temp"
'      .WorkingDirectory = "c:\"
'      .IconLocation = "F:\Code11\test.ico"
      .Save
   End With
   MsgBox "Done creating shortcut"
Proc_Exit:
      On Error Resume Next
      Set oShortcut = Nothing
      Set oWsh = Nothing
      Exit Sub
  
Proc_Err:
   MsgBox Err.Description, , _
        "ERROR " & Err.Number _
        & "   CreateShortcut "
   Resume Proc_Exit
   Resume

End Sub
Go to the top of the page
 
theDBguy
post Jul 16 2019, 03:39 PM
Post#5


Access Wiki and Forums Moderator
Posts: 76,078
Joined: 19-June 07
From: SunnySandyEggo


Congratulations! Good luck with the rest of your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Sami
post Jul 16 2019, 04:13 PM
Post#6



Posts: 49
Joined: 3-April 19



Thank thanks and billion thanks .
Go to the top of the page
 
theDBguy
post Jul 16 2019, 04:23 PM
Post#7


Access Wiki and Forums Moderator
Posts: 76,078
Joined: 19-June 07
From: SunnySandyEggo


Hi. You're always welcome!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
strive4peace
post Jul 16 2019, 05:56 PM
Post#8


strive4peace
Posts: 20,447
Joined: 10-January 04



recognize the code you posted, Sami ~ happy to help ... and glad you know how to change it ~

.. always good to see you, L ~


This post has been edited by strive4peace: Jul 16 2019, 06:21 PM

--------------------
have an awesome day,
crystal
Go to the top of the page
 
theDBguy
post Jul 16 2019, 07:42 PM
Post#9


Access Wiki and Forums Moderator
Posts: 76,078
Joined: 19-June 07
From: SunnySandyEggo


Same here... thumbup.gif

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    23rd August 2019 - 07:05 PM