Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Launching a form in Read Only Mode (Access 2000)

    A small problem here.
    I want to give my users a choice how they will be looking at the data in a form.
    I've given them
    An add new records only mode
    An edit records mode
    and
    a read only mode.
    Except that the last doesn't work for the first record, when the form is opened. As soon as I move off of the 1st record it becomes read only, regardless of what record I'm on.
    I've set the properties of the form to:
    Allow Edits -No
    Allow Deletions - No
    Allow Additions - No
    Data Entry - No

    The relevant line of code -
    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly

    Am I missing something?

    TIA
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Launching a form in Read Only Mode (Access 2000)

    I'm not clear on what you mean by it not working on the first record. Do you mean that when you open the form the first record is editable?
    Charlotte

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Yes, and then if I move off the first record, any other record is read only. If I then move back to the first record it has become read only as well.

    Weird...
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Launching a form in Read Only Mode (Access 2000)

    In that case, you need to look at the code behind the form and any functions called in the property sheet to see what is overriding the initial settings.
    Charlotte

  5. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Code behind the form?
    I'm looking at the OnClick Event in the VBE, the code doesn't refer to any property sheet settings.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Launching a form in Read Only Mode (Access 2000)

    The OnClick event of what? There is no OnClick for a record, only for a form or a control.
    Charlotte

  7. #7
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    The OnClick event of the Button I'm using to launch the form. - Sorry I wasn't clear.

    Update - when I change the code to use
    acFormPropertySettings

    The form launches and is completely blank (well, at least its secure if the users can't see anything).
    Arrgh!
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  8. #8
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Do you mean it is completely blank, or are you just seeing an empty record?

    There are several properties for a form that control what a user can do - and they can be set in code. Those properties are
    Allow Edits The form will be read-only if this is set to No
    Allow Deletionstab]The form will not allow a record to be deleted if it is set to No
    Allow Additionstab]You will not be able to add a new record if it is set to No
    Data Entrytab] You can only add new records and view the ones you have added if this is set to Yes

    You can also use break-points or message boxes in your code to display the settings for these properties - hopefully that will help you debug what is going on.
    Wendell

  9. #9
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Completely blank
    I've set Edits, Additions, Deletions and Data Entry to No in the property sheet for the form. I do not reference them in my code.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  10. #10
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Since it's completely blank, that would make sense if there are no existing records in the table or query the form is bound to. If a table is empty, a form normally starts in data entry mode.

    I think you want to set those properties in your code - with all set to No, the only thing you can do is view records as ReadOnly. The properties work in combination, so if you want to be able to add records and you don't want the user to see the existing records, you set AllowAdditions to Yes, and DataEntry to Yes. Hope that makes sense - this is one area where the Help files are actually fairly good, so that may help too.
    Wendell

  11. #11
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    I also have buttons for launching in Add and Edit mode.
    The buttons use acFormAdd and acFormEdit and seem to work fine. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  12. #12
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Hmmmmmm - OK - I reread the entire thread, and it sounds like something is not behaving as it should. One thing you could try in the code that opens the form is to actually set the the properties in the button Click procedure to set things the way you want them. Copde to do that would look something like:
    <font color=blue><font face="Georgia">Forms!MyForm.AllowEdits = False
    Forms!MyForm.AllowAdditions = False
    ....</font face=georgia></font color=blue>
    But you indicate that the forms has everything turned off, so if you simply open the form from the database container window, it should be in ReadOnly mode. Does that happen? If so, then something really weird is happening. Do you have any code at all that is associated with the form being opened?
    Wendell

  13. #13
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    Not only that, but it is a consistent problem (which probably means I've been doing something consistently wrong). It is reappearing in a couple of other forms I've sent up the same way.
    I tried specifically setting the .allowedits etc properties in the way you suggested and still had no joy.

    _________
    But you indicate that the forms has everything turned off, so if you simply open the form from the database container window, it should be in ReadOnly mode. Does that happen? If so, then something really weird is happening. Do you have any code at all that is associated with the form being opened?
    _____________
    haven't checked that yet ... I'll get back to you.

    Thanks
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  14. #14
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    What service packs do you have applied to Office 2000? This seems really weird, as we do this sort of thing fairly regularly with Access97, 2000 and 2002. I suspect we are missing something key here, but I sure can't put my finger on it at the moment.
    Wendell

  15. #15
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Launching a form in Read Only Mode (Access 2000)

    The machine it first appeared on was not service packed at all. But then I applied SP 3 and the problem is still there...
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Page 1 of 2 12 LastLast

Posting Permissions

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