Results 1 to 7 of 7
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Disable warning message.


    The forms in my app hosts different kinds of buttons. Some buttons open word documents stored externally, some open video clips etc. It always shows the attached error message. I did change the setting under "File" and "Options" to not display other kinds of warnings. I searched the internet but did not find the way to disable the warning below.
    Click image for larger version. 

Name:	230629a.png 
Views:	23 
Size:	46.2 KB 
ID:	50425

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    How do you open the files, I assume you store the link to them as hyperlink and that is the cause of the warning.
    Here are a couple of links on how to edit the registry to remove the warning:
    https://stackoverflow.com/questions/...curity-warning
    https://learn.microsoft.com/en-us/mi...erlink-warning
    https://www.slipstick.com/how-to-out...0the%20warning.

    I avoid the hyperlink data type for this reason (and also the difficulty it present with editing it) and simply save the full path to the files in a regular small text field. Then to open them I use Application.FollowHyperlink or one of the many implementations of ShellExecute.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    1. One of your references has a button, if clicked it fixes the registry, how easy can that be? I did what they suggested manually also, but the warning still there.
    2. In my app there is a form that opens external videos through an attachment, there is no warning there. But the user first opens the attachment page and then select the video.
    3. I would like the result after clicking the button the video clip must instantly start.
    4. The code in blue is where I tried to do what you suggest, the call from the form. The code in red is on the module. The text field is named "Rocky". The button named "btn23".
    5. Most buttons are set up like this, but the warning message is showing.
    6. When I click on the button now, the error is "Bad file name or number". Maybe I save the name wrong in the text field? See the third image. That is where the clip is stored.
    Code:
    Private Sub btn23_Click()
        OpenTutorial23 Me.Rocky.Value
    End Sub
    Code:
    Sub OpenTutorial23(tutName23 As String)
        If Len(Dir("D:\VideoClips" & tutName23 & ".mp4")) = 0 Then
            MsgBox "No Video clip linked."
        Else
        FollowHyperlink "D:\VideoClips" & tutName23 & ".mp4"
    End If
    End Sub
    Click image for larger version. 

Name:	230629b.png 
Views:	10 
Size:	28.3 KB 
ID:	50430Click image for larger version. 

Name:	230629c.png 
Views:	10 
Size:	54.1 KB 
ID:	50431Click image for larger version. 

Name:	230629d.png 
Views:	10 
Size:	15.9 KB 
ID:	50432

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    The error implies the file name is wrong, check the argument for the FollowHyperlink. Maybe something like this:
    Code:
    Private Sub btn23_Click()
        OpenTutorial23 Me.Rocky.Value 'which I believe would be OpenTutorial23 "D:\VideoClips\Rocky.mp4"
    End Sub
    
    
    Sub OpenTutorial23(tutName23 As String)
        if Len(Dir(tutName23)) = 0 'If Len(Dir("D:\VideoClips" & tutName23 & ".mp4")) = 0 Then	
            MsgBox "No Video clip linked."
        Else
        Application.FollowHyperlink tutName23  '"D:\VideoClips" & tutName23 & ".mp4"
    End If
    End Sub
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thanks. The clip opens, but the warning message is still there.

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    If you don't want to try to mess with the registry again (I think the link from MS was suggesting multiple edits) you should try switching to Shell:
    Code:
    Private Sub btn23_Click()
        'OpenTutorial23 Me.Rocky.Value 'which I believe would be OpenTutorial23 "D:\VideoClips\Rocky.mp4"
        OpenTutorial23_Shell Me.Rocky.Value 'use Shell
    End Sub
    
    
    Sub OpenTutorial23(tutName23 As String)
        if Len(Dir(tutName23)) = 0 'If Len(Dir("D:\VideoClips" & tutName23 & ".mp4")) = 0 Then    
            MsgBox "No Video clip linked."
        Else
        Application.FollowHyperlink tutName23  '"D:\VideoClips" & tutName23 & ".mp4"
    End If
    End Sub
    
    
    Sub OpenTutorial23_Shell(tutName23 As String) 'new public sub to add to your module
    On Error GoTo ErrProc
    'FollowHyperlink is not working properly
    If Len(Dir(tutName23)) = 0 
            MsgBox "No Video clip linked."
    Else
        Dim wsShell As Object
        Set wsShell = CreateObject("WScript.Shell")
        wsShell.Run Chr(34) & tutName23 & Chr(34)    
    End If
    
    
    ExitProc:
    Set wsShell = Nothing
    Exit Sub
    ErrProc:
    MsgBox "Cannot open document. Contact database administrator. : " & Err.Number    
    End Sub
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618
    Thank you, Vlad. The result is good.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query generating Warning Message
    By tck0633 in forum Queries
    Replies: 4
    Last Post: 08-10-2018, 03:26 AM
  2. Warning Message After Changing Date
    By Mahendra1000 in forum Access
    Replies: 4
    Last Post: 08-07-2015, 07:38 AM
  3. Pop Message Box Warning
    By data808 in forum Programming
    Replies: 4
    Last Post: 01-11-2014, 04:43 PM
  4. Access Warning Message
    By marksnwv in forum Access
    Replies: 1
    Last Post: 06-01-2012, 01:46 PM
  5. Access warning message
    By John Southern in forum Access
    Replies: 2
    Last Post: 05-28-2010, 06:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums