Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Open Access form from excel hyperlink

This might be a 2 parter-not sure.
I need to use code to set the value in a cell (eg. 101012) to be a hyperlink
which will open an Access file called NewJobs.mdb and open the form Jobs and
goto record 101012 (field name is JobNumber). Say the hyperlinked cell is
cell D2 which is also where the original 101012 would be.

Can anyone help me with this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Open Access form from excel hyperlink

Since I have gotten no replies, here is what I can up with. Instead of using
a hyperlink, I inserted a button with this code behind it:

Global oApp As Object
Sub OpenAccess()

Dim LPath As String
Dim LCategoryID As Long

If Range("D1") 17000 Then
'Path to Access database
LPath = "S:\Time Clock\NJC.mdb"

'Open Access and make visible
Set oApp = CreateObject("Access.Application")
oApp.Visible = True

'Open Access database as defined by LPath variable
oApp.OpenCurrentDatabase LPath

'Open form called Categories filtering by CategoryID
LCategoryID = Range("D1").Value
oApp.DoCmd.OpenForm "Jobs", , , "JobNumber = " & LCategoryID
Else
If Range("D1") = "" Then
MsgBox ("This Order Form does not have a Job Number")
Else
MsgBox ("No job is linked to this Order Form")
End If
End If
End Sub

It seems to work fine except that I would like to be able to check if that
Access file is already open, then it shouldn't open a new instance but
instead, open the form in the instance of Access that is already open. Anyone
have any ideas on this?

"JCanyoneer" wrote:

This might be a 2 parter-not sure.
I need to use code to set the value in a cell (eg. 101012) to be a hyperlink
which will open an Access file called NewJobs.mdb and open the form Jobs and
goto record 101012 (field name is JobNumber). Say the hyperlinked cell is
cell D2 which is also where the original 101012 would be.

Can anyone help me with this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I hyperlink to a name from excel same name in access? CoordinationNOT Excel Discussion (Misc queries) 0 May 7th 09 12:56 PM
Hyperlink in access from excel code JCanyoneer Excel Programming 1 July 6th 06 09:07 PM
How do I import hyperlink data from Access into Excel? Dennis Excel Discussion (Misc queries) 0 February 23rd 06 03:29 PM
Excel Hyperlink to specific Access object Karla V Excel Discussion (Misc queries) 0 July 1st 05 02:35 PM
get access form in excel Laurent M Excel Discussion (Misc queries) 1 January 27th 05 12:30 PM


All times are GMT +1. The time now is 10:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"