Hi All.. I'm hoping someone might be able to help me.
I have a standalone database (not yet split) with about 5 users. The database is used for issue tracking and reporting (one issue per record on a main table). I've utilized a Navigation Form with a sub form in which the data entry occurs.
The other sub forms are being utilized for reporting.
Originally, it was requested to store supporting documentation (emails/excel docs/pdfs) for the issues in an attachment field within the main table. But then it was decided to change the attachment field to a hyperlink in order to save space.
I've been able to do this successfully; however, when the hyperlink is clicked (from the subform) and opens the File Window, it triggers an OnClose event that I have in the Main Navigation Form.
The OnClose command on the Main form is running an update query that populates the users logout time (as the close button on the main navigation form is disabled - and would only trigger when they closed the database).. so NOW when users click the hyperlink, it is causing the logout time to update prematurely. I've tried putting this command on the login form, and hiding it... but it is still triggering the OnClose event on any form I put it in..
I'm seriously puzzled by this. What is the hyperlink doing that is triggering all form OnClose events?
The sub form field that houses the hyperlink is a text box. I have written a public function that is being triggered by a command button.. It creates a folder for new records, and populates the hyperlink to the folder in the text box. I don't see anything in the function that would cause this..
This is the public function:
Code:
Public Function CreateFolder()
Dim fs, cf, x
Dim strFolder As String
Dim newFolder As String
On Error Resume Next
strFolder = "\\COLFSX\SHARE\CIA DOCUMENTATION\CIA ISSUE LOG\ISSUE LOG DB DOCUMENTATION"
newFolder = strFolder & "\CIA-" & [Forms]![Navigation Form].[NavigationSubform].Form.[IssueID]
hl = strFolder & "\CIA-" & [Forms]![Navigation Form].[NavigationSubform].Form.[IssueID]
If IsNull([Forms]![Navigation Form].[NavigationSubform].Form.[IssueID]) Then
MsgBox "Cannot Create Folder for New Record"
Else Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(newFolder) = True Then MsgBox "'" & newFolder & "' already exists!"
Else Set cf = fs.CreateFolder(newFolder)
If fs.FolderExists(newFolder) = True Then [Forms]![Navigation Form].[NavigationSubform].Form.[ATTACHMENTS] = "#" & newFolder
DoCmd.Save
MsgBox "'" & newFolder & "' successfully created!"
Else MsgBox Err.Number & " " & Err.Description
End If
End If
End If
End Function
.
I'm not sure what is happening when the hyperlink is clicked, as there are no events in the text box its self. So, I'm not sure where to look to see what is happening when the hyperlink is clicked.
Any help would be appreciated!
Thanks in Advance
Charity