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

Cannot copy previous field....

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

    Cannot copy previous field....

    Scenario:

    Form is based on a single table. Button on the form with this code: topparent.copy_prev_field(). The form is in enter new record mode. no matter which field has focus, when I push the button, I get this error message: Cannot copy from previous record because current object is not a field.

    According to Alpha Help, this is supposed to work. Why does it not work?

    Thanks,

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    #2
    Re: Cannot copy previous field....

    I ran a test creating a simple table and form, added a record, put on a button and inserted code:
    topparent.copy_prev_record()
    I then went into "Enter new record" mode, pushed the button and voila, it worked!
    However, if I sit on an existing record and press the button it errors with:
    "Cannot copy previous record. You must be in enter mode"
    I cannot generate your error so if you give us a stripped down sample maybe we can see assist further.
    Garry

    Comment


      #3
      Re: Cannot copy previous field....

      Ken, did you find the answer?

      I did as Gary (made a test database with a form and buttons) and found that topparent.copy_prev_record() works, but topparent.copy_prev_field() does not work. I got the same error message as you: Cannot copy from previous record because current object is not a field.

      It appears that when I push the button for copy_prev_field(), the focus shifts from the field to the button, so there is no way for Alpha to know which field to copy from/to.

      Of course, there are other ways to copy from a previous field, but since Alpha gives us this command, it should work.
      Cliff

      Coffee tastes better if the latrines are dug downstream from an encampment.
      - US Army Field Regulations, 1861

      Comment


        #4
        Re: Cannot copy previous field....

        Of course, there are other ways to copy from a previous field, but since Alpha gives us this command, it should work.
        Because it doesn't work from a button doesn't mean it doesn't work at all. Just that the context is wrong. The command is actually the xbasic behind an action script element.

        Perhaps the usage should be triggered by an onkey event?
        There can be only one.

        Comment


          #5
          Re: Cannot copy previous field....

          I haven't tried it, but try to activate the field first, i.e.:
          object_with_field.activate()
          topparent.copy_previous_field()

          Comment


            #6
            Re: Cannot copy previous field....

            Stan, as usual, you are correct. The command works when triggered by an onkey event.

            However, from the help file for <OBJECT>.COPY_PREV_FIELD:

            Example

            This button on a form copies values from the field in the previous record into the corresponding field in the current record that is being entered:

            topparent.copy_prev_field()
            But, I quibble. Use what works, I always say.
            Cliff

            Coffee tastes better if the latrines are dug downstream from an encampment.
            - US Army Field Regulations, 1861

            Comment


              #7
              Re: Cannot copy previous field....

              Originally posted by G Gabriel View Post
              I haven't tried it, but try to activate the field first, i.e.:
              object_with_field.activate()
              topparent.copy_previous_field()
              That's exactly how I did it. I even changed fields. Gave focus to a field and presed the button. No go.

              kenn
              TYVM :) kenn

              Knowing what you can achieve will not become reality until you imagine and explore.

              Comment


                #8
                Re: Cannot copy previous field....

                Originally posted by Garry Flanigan View Post
                I ran a test creating a simple table and form, added a record, put on a button and inserted code:
                topparent.copy_prev_record()
                I then went into "Enter new record" mode, pushed the button and voila, it worked!
                However, if I sit on an existing record and press the button it errors with:
                "Cannot copy previous record. You must be in enter mode"
                I cannot generate your error so if you give us a stripped down sample maybe we can see assist further.
                Garry
                You are trying to copy the previous record rather than the previous field.
                TYVM :) kenn

                Knowing what you can achieve will not become reality until you imagine and explore.

                Comment


                  #9
                  Re: Cannot copy previous field....

                  Originally posted by Stan Mathews View Post
                  Perhaps the usage should be triggered by an onkey event?
                  I thought of that but haven't had time to give it a try. Maybe tonight??

                  kenn
                  TYVM :) kenn

                  Knowing what you can achieve will not become reality until you imagine and explore.

                  Comment


                    #10
                    Re: Cannot copy previous field....

                    Originally posted by cwenger View Post
                    However, from the help file for <OBJECT>.COPY_PREV_FIELD:
                    But, I quibble. Use what works, I always say.
                    Should be reported as a documentation error for correction in the next update. Please do.
                    There can be only one.

                    Comment


                      #11
                      Re: Cannot copy previous field....

                      This is a bug and it is not the ant-type bug, it's most likely the tarantula type. A tip of an iceberg bug.

                      Wish I had more time to investigate, but on quick investigation it looks like when you click the new record icon or try to enter a new record by some other means, the form goes in View or, under other circumstances I've yet to explore, change mode but not on enter mode. Weird and hard to believe that this eluded everyone all this time. Maybe I am wrong. Wish others test to confirm.
                      Do this:
                      On your form put a button with this script:
                      Code:
                      topparent.new_record()
                      x=topparent.mode_get()
                      msgbox(x)
                      See what you get.
                      Tested on some other forms, got the correct expected response: Enter mode.
                      I've got to get to the bottom of this, why in some forms you get View mode while on others you get Enter mode? If I have the time, I will investigate further..
                      Last edited by G Gabriel; 09-22-2009, 04:10 PM.

                      Comment


                        #12
                        Re: Cannot copy previous field....

                        Stan, I reported it as a bug with a sample database and the steps to create the error and the steps to use onkey.

                        Gabe, I tried your test. The button puts the form into enter mode and pops up a dialog box that says "Enter" and an "OK" button.
                        Cliff

                        Coffee tastes better if the latrines are dug downstream from an encampment.
                        - US Army Field Regulations, 1861

                        Comment


                          #13
                          Re: Cannot copy previous field....

                          Ok.. a little bit of a progress here:
                          If your form has an embedded browse, you get the wrong mode. Remove the embedded browse, you get the correct mode. But, it won't copy the previous field in either case so there is more to it than just the mode.

                          Comment


                            #14
                            Re: Cannot copy previous field....

                            Garry,

                            I ran a test creating a simple table and form, added a record, put on a button and inserted code:
                            topparent.copy_prev_record()
                            I then went into "Enter new record" mode, pushed the button and voila, it worked!
                            How did it(Copy_Prev_record()) work?
                            I have as
                            'Copy previous record in current form at Browse8 level.
                            topparent:Browse8.copy_prev_record(1)
                            'Enter new record in current form at Browse8 level.
                            topparent:Browse8.new_record()

                            Comment


                              #15
                              Re: Cannot copy previous field....

                              My reply was 18 months ago!! At my age it's hard to remember what I did a week ago.
                              My test was one a form based on one table and not on a browse so I suggest you just experiment.
                              Sorry that I cannot be of more assistance.

                              Comment

                              Working...
                              X