Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2022
    Posts
    24

    Levering aan klanten is afgeschermd, maar klikken op tab Start biedt ontwerpweergave

    Ik heb voor de levering aan mijn klanten het lint en meer afgeschermd, maar zij kunnen op frmStart klikken om toch in de ontwerpgave te komen.



    Kan ik onderstaande code zo aanpassen dat de tabs van de forms ook niet meer te zien zijn:

    On Error Resume Next
    Dim cat As New ADOX.Catalog
    Dim tbl As New ADOX.Table
    Dim error As String
    Dim hulp As String
    Dim LinkedDB As String
    Dim pos As Long


    Call DoCmd.NavigateTo("acNavigationCategoryObjectType")


    If CurrentProject.Path = "C:\PremiumSoftware_Hans" Then
    'herstel het navigatie window command
    Call DoCmd.SelectObject(acTable, , True)
    'herstel Ribbon
    Call DoCmd.ShowToolbar("Ribbon", acToolbarYes)
    Else
    'verberg navigatie panel
    Call DoCmd.RunCommand(acCmdWindowHide)
    'verberg Ribbon
    Call DoCmd.ShowToolbar("Ribbon", acToolbarNo)
    End If


    'build linked table
    pos = InStrRev(CurrentProject.Name, ".")
    hulp = Left(CurrentProject.Name, pos - 1) & "_be.accdb"


    LinkedDB = CurrentProject.Path & "\data" & hulp


    cat.ActiveConnection = CurrentProject.Connection
    DoEvents
    For Each tbl In cat.Tables
    If tbl.Type = "LINK" Then
    If tbl.Properties("Jet OLEDB:Link Datasource") = LinkedDB Then
    'niet te doen, link is ok
    Else
    tbl.Properties("Jet OLEDB:Link Datasource") = LinkedDB
    If Err.Number = 0 Then
    tbl.Properties.Refresh
    Else
    error = "Error " & tbl.Name & vbCrLf
    Err.Clear
    End If


    End If


    End If


    Next
    'error?
    If Len(error) > 0 Then
    MsgBox error
    End If
    ' disable error handling
    On Error GoTo 0

    Hans

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Non comprende. Lo sieñto
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    Oct 2022
    Posts
    24

    For delivery to my customers I have blocked the lint but I am not able to close thet 'frmStart'

    Quote Originally Posted by HansvanhEERTUM View Post
    Ik heb voor de levering aan mijn klanten het lint en meer afgeschermd, maar zij kunnen op frmStart klikken om toch in de ontwerpgave te komen.

    Kan ik onderstaande code zo aanpassen dat de tabs van de forms ook niet meer te zien zijn:

    On Error Resume Next
    Dim cat As New ADOX.Catalog
    Dim tbl As New ADOX.Table
    Dim error As String
    Dim hulp As String
    Dim LinkedDB As String
    Dim pos As Long


    Call DoCmd.NavigateTo("acNavigationCategoryObjectType")


    If CurrentProject.Path = "C:\PremiumSoftware_Hans" Then
    'herstel het navigatie window command
    Call DoCmd.SelectObject(acTable, , True)
    'herstel Ribbon
    Call DoCmd.ShowToolbar("Ribbon", acToolbarYes)
    Else
    'verberg navigatie panel
    Call DoCmd.RunCommand(acCmdWindowHide)
    'verberg Ribbon
    Call DoCmd.ShowToolbar("Ribbon", acToolbarNo)
    End If


    'build linked table
    pos = InStrRev(CurrentProject.Name, ".")
    hulp = Left(CurrentProject.Name, pos - 1) & "_be.accdb"


    LinkedDB = CurrentProject.Path & "\data" & hulp


    cat.ActiveConnection = CurrentProject.Connection
    DoEvents
    For Each tbl In cat.Tables
    If tbl.Type = "LINK" Then
    If tbl.Properties("Jet OLEDB:Link Datasource") = LinkedDB Then
    'niet te doen, link is ok
    Else
    tbl.Properties("Jet OLEDB:Link Datasource") = LinkedDB
    If Err.Number = 0 Then
    tbl.Properties.Refresh
    Else
    error = "Error " & tbl.Name & vbCrLf
    Err.Clear
    End If


    End If


    End If


    Next
    'error?
    If Len(error) > 0 Then
    MsgBox error
    End If
    ' disable error handling
    On Error GoTo 0

    Hans
    For delivery to my customers I have blocked the lint, but clicking on the tab 'frmStart' opens the possibility to change the code. Can I hide 'frmStart'?

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Lint?
    Supply an accde file. Then no code will be available.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    Oct 2022
    Posts
    24

    Solved

    Quote Originally Posted by Welshgasman View Post
    Lint?
    Supply an accde file. Then no code will be available.
    Problem solved. Thank you!

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

Similar Threads

  1. Replies: 6
    Last Post: 03-02-2016, 12:58 PM
  2. Where to start
    By Adsso in forum Access
    Replies: 1
    Last Post: 02-15-2012, 04:25 PM
  3. How to start?
    By bergjes in forum Queries
    Replies: 8
    Last Post: 12-28-2011, 11:52 AM
  4. VBA Won't Start
    By Randy in forum Access
    Replies: 3
    Last Post: 11-27-2011, 12:27 PM
  5. Where to start?
    By FullyFamous in forum Database Design
    Replies: 7
    Last Post: 12-20-2010, 03:27 PM

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