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

Date field rule doesn't work

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

    Date field rule doesn't work

    I have a table with numerous field rules defined. For the date field, I have a simple expression set as Date(). When the cursor enters the field, todays date comes into view. When I leave the field, the field goes blank.

    I've tried just about every setting that makes sense and a few that do not. The end result is always the same. I have other fields, none date, that work just fine. I have no problem entering a date. The default just keeps disappearing when the cursor moves to either the previous field or the next field.

    TIA

    Ron
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    RE: Date field rule doesn't work

    Ron,

    Here's a simple debugging technique to help narrow the range of possible culprits.

    1) Open the table using the default form. Enter a new record. If the field behaves correctly that's a good indicator the field rules are ok, and that your original problem lies in the form, possibly in actions or events you've programmed there.

    2) My guess is that the problem will repeat itself using the default form for the table. This is a good indicator the problem is not in your custom form, but lies in conflicting field rules. The skip setting in data entry is a likely candidate. In any event, go through all the field rules for the field in question.

    If neither of these leads to a solution, I suggest you compact your database, close alpha five, and the reopen Alpha Five and the database.

    -- tom

    Comment


      #3
      RE: Date field rule doesn't work

      I assume you've set this as a default field in field rules. Try setting the options to fill the field at the start of data entry and set the skip rule to .t. . That way the cursor never enters the field and the value is set when a new record is begun.

      Comment


        #4
        RE: Date field rule doesn't work

        Thanks again Tom.

        Yes, it worked on the default form. Actually, I'm using an embedded browse on the form.

        I traced the problem to what I believe is a bug in Alpha 5. Under properties, the format choice has to be none for the default to work. I didn't try all of the choices, but 12-31-1999 bombs out. As it turns out, selecting none give you 12-31-1999.

        This was easily duplicated on a test table.

        Ron
        Alpha 5 Version 11
        AA Build 2999, Build 4269, Current Build
        DBF's and MySql
        Desktop, Web on the Desktop and WEB

        Ron Anusiewicz

        Comment


          #5
          RE: Date field rule doesn't work

          Ron,

          I've been able to confirm the problem here.

          If the default value (by field rule) is date(), and the box to 'Set default at start of data entry' remains unchecked, then the field gets blanked when the user tabs through the column in an embedded browse, if the user has specified a format setting for the column in the embedded browse.

          If you 'Set default at start of data entry', the format settings for the column don't seem to mind, and the value is retained when the user tabs through the column.

          -- tom

          Comment


            #6
            RE: Date field rule doesn't work

            What if you have 2 fields, one for adding a new record and the other to change date when a change is made in a particular record. i.e 2 fields

            chgdtt
            addtt

            Right now when I add a new record the the change date also records today's date If I remove the default in the event rule I have to type in the date the change is made. Is there a way to have the date something in a record is changed. Any help would be appreciated.

            Nip Lewis

            Comment


              #7
              RE: Date field rule doesn't work

              Nip,

              Field rules for your table are enforced whenever you do data entry through a form.

              If you want to know both when a record was initially created and when it was last modified, you have to use two fields, as you are currently doing.

              The xbasic mode_get() command statements can be used to determine whether the user is entering a new record, or changing an existing one.

              You will either have to modify the field rules to make them conditional, based on the table's mode,

              or

              delete the field rules and use form level events instead.

              The latter may be easier for you. For example, you could put a button on your form to 'Save Changes', and the button's script could update the correct field with today's date, depending on whether the table is enter mode or in change mode. If you do this, then you have to prevent the user from saving changes without pushing the button.

              -- tom

              Comment


                #8
                RE: Date field rule doesn't work

                Actually this is easy to do, I do it all the time with two time fields, and two user login fields. This way I have an informal audit trail of who changed a record and the date and time they changed the record.

                For the "addtt" field in Field Rules|Data Entry set the default value to a simple default expression equal to date(), and check the box to 'Set default at start of data entry'.

                For the "chgdtt" field in Field Rules|Field Types set the estended field types to a calculated field and in the calculated field expression box enter DATE().

                This works like a charm for me.

                Dan
                Dan

                Dan Blank builds Databases
                Skype: danblank

                Comment


                  #9
                  RE: Date field rule doesn't work

                  Dan,

                  thanks! That's much easier than the approach I was describing. Your idea works well in most cases. However, if it's important to track that a change was made on the same date that the record was entered your idea won't solve the puzzle. Why? because the calc field rule supplies the current date to the lastupdated field when the record is created, and when it's changed. Changes on the date the record was created will be indistinguishable from records that have no changes on the date they were entered. However, in many cases that's entirely ok, because changes on the same day as data entry are probably only just data entry error fixes.

                  Thanks again.

                  -- tom

                  Comment


                    #10
                    RE: Date field rule doesn't work

                    Well you are correct for the most part. This is why I use the time field. The time is set in the field rules the same as the date field rules. So if the time is the same for the two fields, it is when the record is created. If the time is different, then the TimeEntered field is when the record is created, and the TimeChanged field is the time when the record is changed.

                    And I also use a log on screen so I actually have the name of the person who created the record and the name of the user who changed the record. (Field rules set the same).

                    The flaw is if one person changes the record, and then an hour later another person comes along and changes the record again, then I lost the actions of the first record change. However, this is just an informal audit trail for simple problem solving. If it was critical data I would use the "Create an Audit Trail" that Peter Wayne describes.

                    Dan
                    Dan

                    Dan Blank builds Databases
                    Skype: danblank

                    Comment

                    Working...
                    X