Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    11

    Unanswered: Read Only queries?

    Hello,
    I'm new to this forum and relativly new to Access. I am using VBA to create a query on the fly. What I want to do in my code is to create this query as read only. I have done this using Macro's but I don't want to use a macro in this case becuase I'm creating my query on the fly based off of user selectable criteria.

    Any help will be appreciated!

    thanks,
    Chuck

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    a select query is read only.
    an update query is write only, well for the columns in the destination that is.
    I suspect that there may be some confusion at where to set the read only attribute.

    if you set the form that is the container for the data as read only, or make the relevant controls locked then you should achieve what you want to do.

    what are you trying to protect using this read only query?

  3. #3
    Join Date
    Jan 2006
    Posts
    11
    Thanks healdem for your reply,
    I am trying to open the query in datasheet view but with read only attributes. Using a macro, I can do this to a static query but I am generating this dynamic query based on users inputs and I'm using code to do this. I was wondering if there was code that could set the query that I'm generating to read only in the datasheet view like the macro does. I may have to create a form for this and lock this fields out but I was originally going to do it the way described above.

    Thanks,
    Chuck

  4. #4
    Join Date
    Jan 2006
    Posts
    11

    Update!!

    Thanks for all the help but I figured out my own question. For anyone interested here is the line of code that made this happen:
    DoCmd.OpenQuery "QueryName", , acReadOnly

    Thanks,
    Chuck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •