I have the following code that is used in an excel spreadsheet to send cell information to some variables. I now need the code to check for an already open MS Access database (if the database is not open I need a msgbox that advises the database must be open to edit items) and use the variables to open a form, filter for a specific record and display the requested record. I have searched up and down and can't seem to find what I need, everything seems to open the database first, but in this case I want the user to already have the database open.
Variable Clickrange is an integer set on open of the excel file and corresponds to a max row range that is included in the clickable range.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Call openitem(Target.Row, Target.Column)
Public Function openitem(myRow As Integer, myColumn As Integer)
If myRow <= myClickrange And myRow > 2 And Left(Format(ThisWorkbook.Sheets("Skyline").Range("B" & myRow).Value, "mmm-yy"), 4) <> "Jan-" Then
myInfo = ThisWorkbook.Sheets("Skyline").Cells(myRow, myColumn).Value
myFirstbreak = InStr(1, myInfo, "(")
mySecondbreak = InStr(1, myInfo, ")")
Projectnum = Left(myInfo, myFirstbreak - 2)
Customer = Mid(myInfo, myFirstbreak + 1, (mySecondbreak - myFirstbreak) - 1)
Programnum = Right(myInfo, (Len(myInfo) - mySecondbreak) - 1)
'I need the code to go here that will open frmMyform if that form is not already open, will enter the 3 above variables into text boxes A, B, and C and then will refresh the form