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

table not in change or enter mode

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

    table not in change or enter mode

    I am having a problem with a form that worked correctly until I attached the following script to the on depart event of Customer_ID field.

    dim i as n
    dim test as c
    i=0
    while icustomer_id,i,1)
    if test complex_code=left(payments->customer_id,i-1)
    i=6
    end if
    end while

    This picks off the alpha characters at the beginning of Customer_ID and puts it in Complex_Code. This works correctly, but when I enter past the last field to enter a new record I get error: table not in change or enter mode.

    The form is based on a set, I don't know if this makes a difference.


    Thanks for any help.

    Lloyd

    #2
    RE: table not in change or enter mode

    Alpha is not saving your changes to "payments->complex code" until you try to advance to the next record. You need to modify your code so that the changes are saved when you depart the field

    dim i as n
    dim test as c
    dim tbl as p
    tbl=table.current()
    i=0
    while icustomer_id,i,1)
    if test tbl.enter_begin()
    payments->complex_code=left(payments->customer_id,i-1)
    tbl.enter_end(.T.)
    i=6
    end if
    end while

    I think this will take care of it.
    There can be only one.

    Comment


      #3
      RE: table not in change or enter mode

      Boy was that lame.

      Change the tbl.enter.. to tbl.change..

      fuess I was thinking of enter from your topic header.

      Sorry
      There can be only one.

      Comment


        #4
        RE: table not in change or enter mode

        LLoyd,

        Just verified that


        dim i as n
        dim test as c
        dim tbl as p
        tbl=table.current()
        i=0
        while icustomer_id,i,1)
        if test complex_code=left(payments->customer_id,i-1)
        Tbl.change_end(.T.)
        end if
        end while


        works. I don't understand the i=6 in your original post. I seems that including that statement would "shut off" your while statement as soon as the first letter is found.
        There can be only one.

        Comment


          #5
          RE: table not in change or enter mode

          Stan

          I forgot to say in my first message that I was opening the payment entry form in enter mode.

          When I tried your suggestion I received an error message that said "change already began".

          When in enter mode don't you just set the field equal to what is typed into the field? If so why can't a field be set with a script and just continue to the next field?
          I might not be explaining what I mean in the correct form, but hope you get the drift of what I am asking.

          Thanks for your help.

          Lloyd

          Comment


            #6
            RE: table not in change or enter mode

            Stan

            In answer to your other question about why I have i=6 in the script, customer_id can start with 3 to 5 alpha characters such as ABS241 or DCGAA12304. I wanted to stop the script when something other than alpha was encountered.
            I thought this was the best way to go.

            Lloyd

            Comment


              #7
              RE: table not in change or enter mode

              Let's go back and try it the other way..

              dim i as n
              dim test as c
              i=0
              while icustomer_id,i,1)
              if test customer_id,i-1)
              parent.commit()
              i=6
              end if
              end while
              There can be only one.

              Comment


                #8
                RE: table not in change or enter mode

                What I'm seeing is that on the first pass through the while statement:

                i gets set to 1
                the test variable gets a value
                the if begins
                the complex_code gets it's first value
                i gets set to 6 ----- and the while stops
                There can be only one.

                Comment


                  #9
                  RE: table not in change or enter mode

                  Ignore the last post about the .value and the parent.commit(). I didn't read the manual closely enough and it doesn't apply to what you are trying to do.

                  Your table may still be in change mode from earlier scripts. Try closing Alpha, restarting, and then making your changes.

                  Hopefully somebody else will give some advice. This is not the strong part of my experience.
                  There can be only one.

                  Comment


                    #10
                    RE: table not in change or enter mode

                    Stan

                    The while stops only if test

                    Comment


                      #11
                      RE: table not in change or enter mode

                      How about trying the .mode_get() statement to see which data entry mode is current (none, change, enter) and then dealing with the result using an IF or SELECT..CASE statement?

                      Comment


                        #12
                        RE: table not in change or enter mode

                        Must be a bad day, I was reading that and not seeing it.

                        Thsnks
                        There can be only one.

                        Comment


                          #13
                          RE: table not in change or enter mode

                          Lloyd if no data entry is occurring manually, and you want the field filled in completely by the script, I'd put it in the on_arrive event, instead of the on_depart... and once it's filled in, I'd activate the next field on the form.

                          this way when the field first gets focus, it gets filled in and then focus moves to the next field in your tab order.

                          if you continue to have trouble, check the properties of the field to verify that you haven't made it read only and that there are no restrictions against writing to it...

                          Let us know how things turn out.

                          -- tom

                          Comment


                            #14
                            RE: table not in change or enter mode

                            Oops! Sorry about that previous post, on re-reading the script I see that you get the customer_id from data entry, and then use it to change the value in the other field. My idea would prevent the id from being entered in the first place. Not good.

                            I'd still check the properties of the target field on the form you are updating, however.

                            -- tom

                            Comment


                              #15
                              RE: table not in change or enter mode

                              One other thing to check... is the customer_id field the last field in your tab order? If so, when you depart Alpha Five may be saving the record before the onDepart script can finish...

                              -- tom

                              Comment

                              Working...
                              X