ScriptKiddy
Technical User
I hope this makes sense.
I am writing come code in a DB to check a link in a DataSheet to verify the file is present. Then I want to have the code change another cell to say whether it is True or False. From there I have the Conditional Formatting set to change the color of a different cell.
I know lots of things happening. I am able to get it to work if I set it to OnCurrent but, when I set it to OnOpen nothing happens.
Here is what I have so far.
Thanks in advance for your time and consideration in this matter.
I am writing come code in a DB to check a link in a DataSheet to verify the file is present. Then I want to have the code change another cell to say whether it is True or False. From there I have the Conditional Formatting set to change the color of a different cell.
I know lots of things happening. I am able to get it to work if I set it to OnCurrent but, when I set it to OnOpen nothing happens.
Here is what I have so far.
Code:
Option Compare Database
Private Sub ScannedFileName_DblClick(Cancel As Integer)
''Hyperlink Open
On Error GoTo ScannedFileName_DblClick_Err
Dim ctl As Object
Set ctl = Me!OpenScannedPDF
With ctl
.Visible = False
.HyperlinkAddress = "\\NetworkDrive\Digital Sender\" + Me.ScannedFileName + ".pdf"
.Hyperlink.Follow
End With
ScannedFileName_DblClick_Exit:
Exit Sub
ScannedFileName_DblClick_Err:
Resume ScannedFileName_DblClick_Exit
End Sub
Private Sub Form_AfterInsert()
Me.Refresh
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.Refresh
End Sub
Private Sub Form_Open(Cancel As Integer)
'Verifies that a Scanned File is Present in the Digital Sender Directory
With Application.FileSearch
If Me.ScannedFileName = True Then
'Conditional Formating Makes the ScannedFileName Cell Turn Green
Me!colorTF = True
Else
'Conditional Formating Makes the ScannedFileName Cell Turn Red
Me!colorTF = False
'MsgBox for Test Purposes Only
MsgBox "Nothing has been scanned for this record."
End If
End With
End Sub