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

"Previous" value won't Post to field

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

    "Previous" value won't Post to field

    I needed to use the a field value from the Previous record to calculate current balance. I setup a field to capture this value called TEMP. In the field rules, I used calculate feature to define the expression...
    Previous(current_value). The cuurent_value field expression was TEMP+ADJUSTMENT (which added adjustment to previous "current_value").

    In the entry table the values appeared as expected until I saved the record... the TEMP field went blank, and the result was simply the ADJUSTMENT value. Is this a bug or am I missing something? The previous value was called and appeared properly but vanished as soon as the entry record saved. (A5V5)

    #2
    RE:

    ...I setup a field to capture this value called TEMP...

    Maybe it takes the name of the field for a literal intrepretation? Seriously, Why did you name the field Temp? Because it was intended to only temporarily store a value? I'm suspecting you've got something in you setup to do just that. If so, you'll need to make a change.

    kenn
    TYVM :) kenn

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

    Comment


      #3
      RE:

      Actually I tried to use the "Previous value command" into the direct expression and got the same result.
      The current_value field expression was: previous(current_value)+ ADJUSTMENT (which added adjustment to previous "current_value").
      Here again the new value was correct until the record was saved. At that point it appears previous(current_value) vanishes... really weird. Why would the statement be invalid after it attemps to save the record?

      Comment


        #4
        RE:

        Sid,

        May I ask why you're storing the adjusted balance in the current transaction record? Many designers wouldn't do it, since the figure will be wrong as soon as the user adjusts any of the earlier transaction records later on. It's also easy to compute the current adjusted balance just from the transactions table, whenever needed for a form or report, so why go to the trouble of computing it each time a transaction record is saved? If I've misunderstood what you're describing, I apologize, but thought I'd ask...

        -- tom

        Comment


          #5
          Running Balance?

          I thought Tom made an excellent point, so if you stay with the running balance methodology, I think you should follow his advice.

          Although many developers use the running balance method, I personally have a couple of issues with that methodology. In addition, I much prefer using what I think is a more intuitive and easier paradigm. Why don�t you think about using two child tables, one for debits and one for credits, both linked to the parent table by a field such as Inv_No or Acct_No?

          Next, do the following in the parent table. Create one field to store the total debits for that invoice or account , and one field that stores the total credits for that invoice or account. You will also need a third field called BALANCE, which is a simple calculated field [Debits � Credits]. In essence, this third field will replace what you are currently calling your running balance.

          Every time a debit or a credit is entered into one of the child tables, you have at least two choices

          [1] You can post the amount of the debit or credit to the appropriate field in the parent table

          or

          [2] You can do what I do and love, thanks to a fantastic tip from Steve Workings. You can write a relatively simple Xbasic script that calculates the total debits or credits for that invoice or account, each time a child table transaction is entered. This script then replaces the old value of the debits or credits in the parent table with the new total.

          Using such a methodology is very simple and the users will automatically see the new and updated CURRENT BALANCE in the parent table portion of your data entry form every time a debit or credit is entered into a child table.

          Robert

          Comment


            #6
            RE:

            Tom-
            Users dont have direct access to this table.
            it provides cashdrawer balances based on the cash added or removed in a transaction in the field called "Adjustment" which is then added to the last record "current_value." The cash in the drawer is previous(current_value)+ ADJUSTMENT.... seemed like the most straight forward way to go!!

            Comment


              #7
              RE:

              As you can see I've been messing with this previous value/record command for a couple of weeks.

              The latest version of Alpha 5 V5 made it work to some degree, but unless you're using it directly in the Table the field expression applies to it it doesn't work properly. If I use a form or a set it won't post the value properly... then I have to run an update operation to apply the value. The functional description of the previous("field") is non-existent as near as I can tell.

              The application is so basic, I can't understand why there isn't a simple answer. All I want to do is take a positive value and a negative value create an algebric sum and add that to the sum found in the previous record... not a rocket scientist chore even though it has turned out to be in Alpha 5.

              Here is the simple field expression: previous("balance")+ (positive_value - negative_value)
              This should take the value in the "balance" field last record and add it to the sum of the positive and negative fields. As I said it works fine as long as you work inside the TABLE where the field is specified.

              Any rocket scientists out there????

              Comment


                #8
                RE: Running Balance?

                Robert,

                I've tried posting the debits and credits to a parent table but it is necessary to get the previous balance from somewhere. The posting process requires me to run an update operation to make the expression actually calculate in the field.
                I want the transaction to be recorded so the user can verify debits and credits, based on other entries.

                2 other people have emailed me asking if I found a solution, but so far I can't figure it out.

                Comment


                  #9
                  RE:

                  What Tom and Robert say is good advice but if you want to keep the running balance this way you might try putting xbasic on the onsave event for the form that
                  puts the value of the balance field in a variable and then adds it to the value in the other field. (not sure I have the field names straight). This can be done with action scripting pretty easily.

                  If what you want is a running balance, I have found this to be harder than I thought using events (for me anyway) but can be done using a simple table to hold the balance amount and using posting.

                  Russ

                  Comment

                  Working...
                  X