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

Copy field's contents

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

    Copy field's contents

    How can I copy the contents of fld1 or fld 2 to fld3? I've been working at this for awhile, tyring to copy, post, etc. So far I'm baffled.

    Thanks,

    kenn
    TYVM :) kenn

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

    #2
    RE: Copy field's contents

    Ken there are several different ways this might be done. Can you describe the context for what you want, including:

    1) are all 3 fields in the same table?
    2) are they on the same form?
    3) when do you want the copy to occur? (when cursor leaves field2? when record is saved? when record is changed?)
    4) how do you want changes and deletions handled?

    -- tom

    Comment


      #3
      RE: Copy field's contents

      Tom,

      1. They are in the same table
      2. The 1st 2 fields, where data would be entered are on the same form. The 3rd field, where the data should be copied to, only needs to be used for storage as a basis for reporting.
      3. The copy can occur at any time.
      4. There is not likely to be a change but in the event there should be, the copy could replace the value.

      Thanks,

      Ken
      TYVM :) kenn

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

      Comment


        #4
        RE: Copy field's contents

        you should be able to do something like:

        field1.value=field2.value
        parent.commit()

        field3 can be wriiten to in the same way, but if you want it just for storage, and hidden from the user, then you can hide it in several ways, but I do this:

        go into the field's properties, and change the backround and font colors of the field to be the same as the background color of the form; also, be sure the border is set to no border. Then, remove tab stop, and make the field read only and disable it (all through the field's properties). Lastly, move the field out of the way (I move it to the upper left corner), and drag it to a very small size so it doesn't cover any other form objects.

        I hope this helps.

        Gary
        Gary S. Traub, Ph.D.

        Comment


          #5
          RE: Copy field's contents

          Gary,

          Field3 will not need to be on the form at all. I'll only need it when creating an expression at report time.

          field1.value=field2.value
          parent.commit()

          I interpret the expression to mean the value in field1 will = the value in field 2. What I need is to have the field1.value or the field2.value copied to field3. I don't understand how the above expression will do that.

          Thanks,

          kenn
          TYVM :) kenn

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

          Comment


            #6
            RE: Copy field's contents

            You said 'The copy can occur at any time.'

            This confuses me. If the tab order during data entry is field1, then field2, and the user keys something into field1, do you want to copy it to field3 as the cursor moves from field1 to field2? Do you want to wait for field2? What if both field1 and field2 have data? Which to copy to field3?

            Color me confused...

            -- tom

            Comment


              #7
              RE: Copy field's contents

              Tom,

              If feild 1 has data, field 2 will be empty and visa versa.

              ken
              TYVM :) kenn

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

              Comment


                #8
                RE: Copy field's contents

                Ken:

                field3 can be on the form as a covenience to make the copying easier. What we need to know is when do you want the copying done. If you want it to occur as you enter or leave a field, then put code in the field's event. For example, you can put
                field3.value=field.value
                parent.commit()

                in the OnDepart event of field1. Try it out. It will work.

                Gary
                Gary S. Traub, Ph.D.

                Comment


                  #9
                  RE: Copy field's contents

                  if the three fields are in the same file, then I might write something like this, at your desired event, whether it is a button or whatever:

                  tbl=table.current(1)
                  '' number respresents which file in the set where 1 is the parent, 2 is the first child, etc.

                  tbl.field3=rtrim(tbl.field1) + " " + rtrim(tbl.field2)
                  parentform:field3.refresh()
                  end

                  ''if you want field3 to grow each time you could say
                  tbl.field3=rtrim(tbl.field3) + " " + rtrim(tbl.field1) + " " + rtrim(tbl.field2)
                  Cole Custom Programming - Terrell, Texas
                  972 524 8714
                  [email protected]

                  ____________________
                  "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                  Comment


                    #10
                    RE: Copy field's contents

                    Or if this is to happen at every occurance for every record, I would go to field rules. Make Field 3 a calculated field.

                    Use this calculation in the expression.
                    rtrim(field1)+rtrim(field2)

                    That should do it
                    Dan
                    Dan

                    Dan Blank builds Databases
                    Skype: danblank

                    Comment


                      #11
                      RE: Copy field's contents

                      Dan,

                      Arguement is incorrect data type. Yet all three feilds are date fields. Will that make a difference?

                      Thanks,

                      kenn
                      TYVM :) kenn

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

                      Comment


                        #12
                        RE: Copy field's contents

                        scratch the parentform:field3.refresh(). just noticed that it doesn't need to be on the form.

                        another option is go the the file's field rules, events tab, and then all the way to the top to the file itself, rather than one of the fields, and then to the "cansaverecord" event. and enter something like this:


                        tbl=table.get("yourfilename")
                        tbl.field3=rtrim(tbl.field1) + " " + rtrim(tbl.field2)

                        this language is absolutely wonderful
                        following is a snippet i use for maintaining an audit trail file, (entered in fieldrules):

                        ''cansaverecord event
                        tbl=table.get("payment history")
                        dim mode as n
                        mode=tbl.mode_get()
                        if mode = 2 '1=change, 2=enter
                        tbl.date_added=date()
                        elseif mode=1
                        tbl.date_changed=date()
                        else
                        end
                        end if
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                          #13
                          RE: Copy field's contents

                          if field1 and field2 are date fields then field3 needs to be a character field - amend the code to the following:

                          tbl.field3=dtoc(tbl.field1) + " " + dtoc(tbl.field2)

                          the result looks like this:
                          "09/03/2000 08/03/2000"
                          Cole Custom Programming - Terrell, Texas
                          972 524 8714
                          [email protected]

                          ____________________
                          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                          Comment


                            #14
                            RE: Copy field's contents

                            I zipped up the table and attached it to this post.

                            Thanks

                            ken
                            TYVM :) kenn

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

                            Comment


                              #15
                              RE: Copy field's contents

                              OOPS, forgot to attach it.
                              TYVM :) kenn

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

                              Comment

                              Working...
                              X