Results 1 to 9 of 9
  1. #1
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72

    Hiding queries

    I want to hide/protect my query because I don't want users to be able to modify the design view.
    So I found this code online:
    Code:
    dim db as database, qd as querydef
    set db = currentdb()
    for each qd in db.querydefs
    msgbox qd.name
    next
    set db = nothing
    I don't know if this works and I don't know where to put it to make it work ><

    Also if you have an alternative solution, I am all ears!


    Thanks in advanced!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    All that will do is display each Query Name in a MessageBox one at a time. Have you considered *only* releasing an ACCDE and not the ACCDB?

  3. #3
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    Ahh thanks for the response! mmm gotcha! I'm using the ACCDE version and query is still available in design view Or did I do something wrong?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Hmmm... I'd better go check.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Well it looks like ACCDE locks out design view on Forms, Reports and Modules but not Tables, Queries and Macros. How about going into Access Options and unchecking the options you want to rescrict? You could also lock out the ShiftBypass option.

  6. #6
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    Hmm... that's interesting. Will do thanks! I've heard of that...what does the shift bypass do? I know it'll bypass form on database load but that's it :P

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    ShiftBypass: http://access.mvps.org/access/api/api0068.htm
    *NOTE* don't lock yourself out of the db!

  8. #8
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    oooo Thanks I'll try not too xD although I have an unprotected backup jussstt in case

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Smart move!

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

Similar Threads

  1. Hiding a subreport
    By castufari in forum Reports
    Replies: 3
    Last Post: 11-23-2011, 08:21 PM
  2. Hiding code
    By Maximilian_Slade in forum Programming
    Replies: 2
    Last Post: 10-26-2011, 07:33 AM
  3. Hiding toolbar?
    By BAX5127 in forum Access
    Replies: 2
    Last Post: 04-06-2011, 10:58 AM
  4. Hiding Macro
    By datacase in forum Access
    Replies: 3
    Last Post: 01-07-2011, 08:41 AM
  5. Hiding Zeros
    By Alex Motilal in forum Reports
    Replies: 2
    Last Post: 08-06-2010, 08:28 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