Results 1 to 12 of 12
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reloading a Form When Data is Write Enabled (Access 2000)

    I'm working on a split DB application where the data file is contained in ClearCase (ClearCase is a version control application used in code development, kind of like Visual SourceSafe). Whe the user starts the application the data file is not checked out and is read-only. If a data entry form is displayed, of course, the user cannot add, delete or edit the data displayed. I've got a command button on the data entry form that allows the user to check out the data file, but I need to know what to do to the form to get it to reload, recognizing that additions, deletions and edits are now allowed. I found that the corresponding properties are true even when the data file is read-only, so that doesn't work. The command button calls a modal popup form to help the user do the check out, but this form gets called from more than one location. Do I need to add code here to close the form if it's loaded and reopen it?

    I'd rather have the code to do this in the data entry form, but I can't see how to make it happen.

    Any ideas?

    Thanks.

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    The database file's Read-Only attribute that was in effect at time you opened database will persist for as long as the database remains open. So if database file was Read-Only when opened, you won't be able to update data or make design changes, even if Read-Only attribute is turned off thru some mechanism while database is open. I've never heard of ClearCase, but you can test this by changing Read-Only attribute by changing file properties in Windows Explorer while file is open. So re-loading form will do no good, you will have to close & re-open database to make any change in Read-Only attribute effective, whatever the mechanism used to change this property. Or change Read-Only attribute before launching application.

    HTH

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

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    I'm not sure I understand. Visual Source Safe is used in a development environment to version the design of the application. The way you're describing this sounds like you have users, rather than developers, actually working with the application while it's in ClearCase. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    I'm not familiar with ClearCase but in VSS, if you want data to be added to a table and saved, you have to check out the data objects first. If the table is linked to a back end, you have to have the data objects in the back end checked out before you open the front end database that links to it.
    Charlotte

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    In previous reply I overlooked fact that the data being updated apparently resides in linked tables. In that case, you do NOT have to close & re-open database, but you may have to close & re-open form after the file with linked tables has read-only property turned off. The only way I was able to make form change from read-only to updatable in this situation WITHOUT having to close & reload form was by applying or removing form's Filter/Sort property. This worked whether done by using menu commands, or by using code to set form's FilterOn property to True or False, or by using DoCmd.ApplyFilter command. Oddly, requerying or refreshing the form had no effect - it remained read-only. Maybe someone can explain this. Also tried refreshing links for linked tables while form open but this did not work.

    NOTE: If form has any subforms, they will remain read-only. To make subform updatable in this case same rule applies, apply or remove subform's Filter/Sort property.

    HTH

  5. #5
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    Thanks for the info, Mark, but that's not what I'm seeing. If I open the form without the file checked out, it opens as if the AllowAdditions, AllowDeletions and AllowEdits properties are set to false. If, however, I check out the data file and reopen the same form, everything is enabled. Note that I don't close the application in the process.

    So the question remains: IS there a way to have a form close and reopen itself or will I have to do it from the dialog that performs the checkout?

  6. #6
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    Charlotte,
    ClearCase (a product of Rational Corp, www.rational.com) provides the same capability for us that you describe for VSS. It provides versioning for the FORTRAN and C/C++ code we maintain. It also happens that the data for the application in question is contained in ClearCase. The application is used by our developers for the tracking of metrics and resides in the same environment. It happens that using ClearCase provides us with a convenient way of exchanging the data with a remote site in MA and a common location for all our local users.

    As for the question of having the backend checked out (write enabled) prior to opening the front end, note that I am currently able to open the front end, check out the file (using a tool in the front end application) and edit data in the back end using the data entry form. The problem arises when the data entry/edit from is opened prior to checking out the data file.

    The question then is whether there is a way to have a form close and reopen itself?

    Thanks.

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

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    Hi Bill,
    From what you've said, I don't believe there is any way to make the form close and reopen without at least switching to design view. So I think you might as well close and reopen the form from the check-out dialog. In one of the other posts, you indicate that the form is used from other places in the application, so you would want to put a hidden control that indicates where the dialog was called from so you know whether or not to close and reopen the form. Hope that makes some sense.

    BTW, is you back-end data being stored in an MDB file that is being managed by ClearCase? The product sounds interesting to us, as there are times when we would like to have some change information tracked on data where a person could conceivably have edit directly in the table.
    Wendell

  8. #8
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    If you just want the form to close & re-open itself, you can use code like this:
    <pre> Dim strForm As String
    strForm = "Name_of_Form"
    DoCmd.Close acForm, strForm
    DoCmd.OpenForm strForm
    </pre>

    This should work whether procedure called from the form being closed itself, or from another form such as a dialog-type form.

    HTH

  9. #9
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    Yes, the data file is controlled by ClearCase. It doesn't work quite as well as code modules (which are just text files) because ClearCase can't compare versions and doe merges as easily, but it does let you maintain a history of changes. We also maintain the front end for versioning purposes only. The developers that are actually using the application install it on their machines for use.

    HTH

  10. #10
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    Colorado, USA
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    That's just the ticket. Thanks! I just assumed that code running when the form closed would stop where the close command was executed. If I had applied a little thought to this assumption, I probably would have realized that it was wrong. I guess a 'duh' is in order. <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    Thanks again for the help.

  11. #11
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    You probably shouldn't have even mentioned the ClearCase application in your original post, it just got everyone sidetracked from main issue of how to reload the form.

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

    Re: Reloading a Form When Data is Write Enabled (Access 2000)

    Actually, I'm glad he did, as we occasionally have requests to track changes in Access back-ends, and I didn't know the product existed.
    Wendell

Posting Permissions

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