Thursday, October 22, 2009

How to add a hyperlink on a intranet to open an access database

Using a unc path with file: in front of the unc path should do it.
e.g. File://Servername/ShareName/Folder/../something.mdb

You can even use the above method to point to a shortcut.
Noting that shortcuts end in .lnk (that's a L not a capital i)
e.g. File://Servername/ShareName/Folder/ShortcutToDatabase.lnk

That way you can specify the link to run the 2003 or 2007 version of access and to open in shared mode – so no locked out users.

The biggest issue is probably that spaces might need to be %20 instead .

Tom Bizannes
Microsoft Access Design and Development
Sydney, Australia
http://www.macroview.com.au

Tuesday, October 06, 2009

Excel Toolbars

Note: Make the toolbar more robust:

Call your proc but add the full path as per the workbook with the code

.OnAction = "'" & ThisWorkbook.Path & "\" & ThisWorkbook.Name & "'!SystemInfo"

eg
Public Sub Auto_Open()
Dim cBar As commandbar
Dim cbarReports As commandbar
Dim myControl As CommandBarButton

For Each cBar In Application.CommandBars
If cBar.Name = "Toolbar_Name" Then
cBar.Delete
End If
Next cBar

Set cbarReports = CommandBars.Add("Toolbar_Name")
'Add System button
Set myControl = cbarReports.Controls.Add(Type:=msoControlButton)

With myControl
.Style = msoButtonCaption
.BeginGroup = True
.Caption = "About"
.OnAction = "'" & ThisWorkbook.Path & "\" & ThisWorkbook.Name & "'!SystemInfo"
End With

End Sub