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

Placing a Calculated Field Result in Another Field

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

    #16
    Re: Placing a Calculated Field Result in Another Field

    I just tried it in the interactive window and it's giving me an error stating the calculated field is "not found". Could that be because the function I created for that field is based on data from the set and not just the table I'm working within?

    Comment


      #17
      Re: Placing a Calculated Field Result in Another Field

      Those ARE the object names and not just the field label.
      But you didn't say so and the most plausible explanation was that they weren't.

      I just tried it in the interactive window and it's giving me an error stating the calculated field is "not found".
      Quite right. The calculated field isn't found in the interactive window, it's on the form.

      the function I created for that field is based on data from the set
      Unclear about what "function" you mean. If the calculated field exists on the form then you should be able to store the current value in the table field utilizing the cansave event.


      I'll get back with a simple example that might help.
      There can be only one.

      Comment


        #18
        Re: Placing a Calculated Field Result in Another Field

        Sample attached. Unzip to a new directory or a current directory where you don't have a table named example. Add that table to your database.

        Enter records on the form. As each record is saved the value in the calc_test field is stored in the table field storage. Where the calc_test calculated field gets its value is irrelevant. Whatever value it has will be stored, given it is the correct data type.


        wri_calc.zip
        There can be only one.

        Comment


          #19
          Re: Placing a Calculated Field Result in Another Field

          Thanks Stan I'll try it out. And you're right, I did not say so earlier in my post. My apologies for not being nearly clear enough.

          Comment


            #20
            Re: Placing a Calculated Field Result in Another Field

            No need for apologies. It's just that we have to be precise when we tell Alpha what we want to do. 99% of the time the object name will be the field name because few knowingly change it. It's just that if you place a field on a form more than once and remove all but one, Alpha names the second and subsequent instances with an incremented digit. (It can happen during development.) So you might wind up with the object name not being what you expect.
            There can be only one.

            Comment


              #21
              Re: Placing a Calculated Field Result in Another Field

              The expression you're using is the same format I am using exactly. After reading your last post I thought perhaps I didn't have the data type correct so I checked all that. Both are numerical fields and are formatted exactly the same within the properties box. I'm stumped.... I gotta tell ya.

              Comment


                #22
                Re: Placing a Calculated Field Result in Another Field

                Time to attach a sample of your database for analysis.

                You could start the cansave event code with

                debug(1)

                That way the debugger will open when the event fires and you may get an error message that doesn't show during normal use. Use F12 to step through the code.

                Your table storage field is user entered type, not calculated?
                There can be only one.

                Comment


                  #23
                  Re: Placing a Calculated Field Result in Another Field

                  Could this be because on the "OnSave" event we lock the record upon saving it? I shouldn't think so as you stated the "CanSave" event actually performs prior to saving.

                  Comment


                    #24
                    Re: Placing a Calculated Field Result in Another Field

                    Yes, it is user entered :"Type in" , in the properties box.

                    Comment


                      #25
                      Re: Placing a Calculated Field Result in Another Field

                      I'll try debugging it also.....

                      Comment


                        #26
                        Re: Placing a Calculated Field Result in Another Field

                        Also checked field rules... definitely user entered....

                        Comment


                          #27
                          Re: Placing a Calculated Field Result in Another Field

                          Ok, got it figured out with the help of Tom Cone. I feel completely foolish now because the one thing I didn't do when opening an existing record was to actually CHANGE the recoed and then save. I was opening and then saving with no change to the record. It is working just fine now. Thank you especially to Stan Matthews and all others who helped on this. And, in the future I will try and be more concise with my explanations.

                          Comment


                            #28
                            Re: Placing a Calculated Field Result in Another Field

                            Originally posted by draxx View Post
                            Could this be because on the "OnSave" event we lock the record upon saving it? I shouldn't think so as you stated the "CanSave" event actually performs prior to saving.
                            Scott

                            Are you coding a lock in the Save events?

                            Definitely a sample is on order here. Stan has the patience of a prince, but this has drug out for quite a few posts....

                            edit: Glad it's solved. A sample would have saved some time..
                            Al Buchholz
                            Bookwood Systems, LTD
                            Weekly QReportBuilder Webinars Thursday 1 pm CST

                            Occam's Razor - KISS
                            Normalize till it hurts - De-normalize till it works.
                            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                            When we triage a problem it is much easier to read sample systems than to read a mind.
                            "Make it as simple as possible, but not simpler."
                            Albert Einstein

                            http://www.iadn.com/images/media/iadn_member.png

                            Comment


                              #29
                              Re: Placing a Calculated Field Result in Another Field

                              Thanks Al.... I know a sample may have saved time but our database is huge. We also are under strict confidentiality clauses with our clients as almost all of them are California Counties and they are extremely strict about confidentiality. I'm glad it got figured out but I do hear what you're saying. I'm very grateful for all of you who respond on this forum. I don't mean to take up anyone's time needlessly, but I was stumped.

                              Comment


                                #30
                                Re: Placing a Calculated Field Result in Another Field

                                If you want to store that calculated value without making a change to a record, use the same code for the onfetch event.
                                There can be only one.

                                Comment

                                Working...
                                X