Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Restricting Record Changes on a Tabbed Subform

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Restricting Record Changes on a Tabbed Subform

    I have a tabbed subform for a database consisting of a parent table and 2 child tables. I wish to prevent changes to the parent record (which is on its own page of the tabbed subform), but allow changes to the child records (on separate pages of the tabbed subform). I know that I can restict command access to the entire form or to fields individually. Is there a way to restrict access to a single tabbed page?

    If I restrict fields individually, does that mean that they can't be further edited after they have been entered initially before saving the record? That would not be acceptable. I only want to prevent changes to the record after it has been committed.

    At present, my strategy is to restrict access to the entire form and allow editing to the child records by placing buttons on the appropriate pages to call child forms where editing is allowed.

    Is there a better way to do this in Alpha 5?

    Best regards,
    Robin Sculthorpe

  • #2
    RE: Restricting Record Changes on a Tabbed Subform

    Robin,

    You don't mention whether the child tables are displayed on browses on the tabbed form. In a one to many situation you will probably want to display child records in a browse which may be but need not be on a tab of a subform.

    If you place parent and child fields on a form (or subform) your users will see a record for each parent-child combination which could be quite a few. For example a parent with three records in each child table would show six times which may not be what you want.

    Even if your child tables are displayed in browses on separate tabs I would advise against placing parent fields on their own tab because the visual message conveyed by this disposition of fields is of three entities at the same level of subordination which is contrary to the structure of the data you are displaying: a superordinate parent with two subordinate data domains.

    Bill
    Bill Hanigsberg

    Comment


    • #3
      RE: Restricting Record Changes on a Tabbed Subform

      Actually, both child links to the parent are one to one and I am not using any browses. The sole purpose of the two child tables was to provide a table for memos that can be edited and another table for information that I want to allow the end user to edit as well. The parent file must not be editable after the parent record is committed. I was hoping that there might be a way to restrict editing for the parent table, but allow editing for the child tables all of which appear on the tabbed subform (each table on its own separate page). I don't know if this is possible.

      Thank you for your help and consideration.
      Robin Sculthorpe

      Comment


      • #4
        RE: Restricting Record Changes on a Tabbed Subform

        Robin,

        If everything must be done on a single form I think you will have to dynamically disable and enable individual fields as necessary using code attached to form events.

        An alternative would be separate forms to edit the child records. In other words prevent enters and changes on in your main form but provide a button to edit each current child record which would call up a form containing only the fields where you want to allow data entry.

        Bill
        Bill Hanigsberg

        Comment


        • #5
          RE: Restricting Record Changes on a Tabbed Subform

          You might try putting a parentform.restrict_change() event in the OnTabChange event. Something like the following:

          No = Tabbed1.tab_get()
          Choice = Tabbed1.tabs.sheet[No].text
          select
          case Choice = "child tab name here"
          parentform.restrict_enter = .t.
          parentform.restrict_change = .t.
          case Choice = "parent tab name here"
          parentform.restrict_enter = .f.
          parentform.restrict_change = .f.
          end select
          end
          Peter
          AlphaBase Solutions, LLC

          Peter@AlphaBaseSolutions.com
          https://www.alphabasesolutions.com


          Comment


          • #6
            RE: Restricting Record Changes on a Tabbed Subform

            Hey Peter,

            That's a nice approach and creates a motive for segregating the fields he doesn't want edited on a separate tab.

            Now suppose he didn't do that. Is there an easy way to measure that no tab is active, that is, a field not on the tabbed object must be active? Then you could change the properties of the form with code on that event.

            Of course if there weren't too many non-tab fields he could just hang prevent enters/changes on the can_arrive of each of them and allow enters/changes on the activate of each tab.

            Bill
            Bill Hanigsberg

            Comment


            • #7
              RE: Restricting Record Changes on a Tabbed Subform

              Hello Bill,

              Of course if there weren't too many non-tab fields he could just hang prevent enters/changes on the can_arrive of each of them and allow enters/changes on the activate of each tab.

              I guess my approach would be to code the form's OnInit event and the tabbed object event. There is probably a clever way to code "OnTabDepart event" or "OnFormArrive event" - if you know what I mean.

              Got to catch a plane to NY. Will be back Monday sometime.

              Peter
              Peter
              AlphaBase Solutions, LLC

              Peter@AlphaBaseSolutions.com
              https://www.alphabasesolutions.com


              Comment


              • #8
                RE: Restricting Record Changes on a Tabbed Subform

                Peter and William,

                Thank you so much for your discussion and ideas. I am converting an Alpha 4 application to Alpha 5, but I am still thinking inside the Alpha 4 "box". Alpha 5 obviously opens up a lot more potential for handling problems efficiently, but it seems hard to even know where to begin. Of course, I could handle this situation the same way that I did in Alpha 4 (which was with separate child forms that could be edited), but I don't want to miss any opportunities to make the application better than before. If I can accomplish what I need with one tabbed subform that would be so much simpler. I greatly appreciate your help and will be experimenting with your ideas.

                Thanks again,
                Robin Sculthorpe

                Comment


                • #9
                  RE: Restricting Record Changes on a Tabbed Subform

                  Robin,

                  When you wrote, "I am converting an Alpha 4 application to Alpha 5, but I am still thinking inside the Alpha 4 'box'," you describe a process all who started in A4 have undergone. I recreated my most significant A4 application twice: once (if I can put it this way) as an A4 application using the A5 platform and second as a true A5 application, conceived in A5.

                  It took me time to make that transition but it is worth it because so much more is possible in A5.

                  Best wishes,
                  Bill
                  Bill Hanigsberg

                  Comment


                  • #10
                    Re: Restricting Record Changes on a Tabbed Subform

                    Originally posted by Peter.Greulich View Post
                    You might try putting a parentform.restrict_change() event in the OnTabChange event. Something like the following:

                    No = Tabbed1.tab_get()
                    Choice = Tabbed1.tabs.sheet[No].text
                    select
                    case Choice = "child tab name here"
                    parentform.restrict_enter = .t.
                    parentform.restrict_change = .t.
                    case Choice = "parent tab name here"
                    parentform.restrict_enter = .f.
                    parentform.restrict_change = .f.
                    end select
                    end
                    Hi Peter, I'm trying to do something similar. I would like to make Jan, Feb, Mar, ect... month dynamically enabled/disabled depending on the current month. Thereby locking the previous months records for editing. How would I do that? I have a single form with Jan - Dec, and Total values.

                    thanks,

                    Mark

                    Comment

                    Working...
                    X