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

resetting calendar supercontrol

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

    resetting calendar supercontrol

    I haven't been able to find anything on this.

    I have a calendar supercontrol on a form. The form is based on a client table. I have the calendar event onDateSelect run a script that writes the calendar chosen date to the date_scheduled field on the client form. I navigate from client to client and wish for the supercontrol to reset back to todays date when I fetch the next client. I can't figure out how to re-initiate the calendar supercontrol back to todays date OnFetch. Anyone know how to do this?

    Thanks.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    #2
    Re: resetting calendar supercontrol

    Mike

    I am sure there is an easier way to do this - just not that familiar with the calendar supercontrol. I have only used it once since I feel that it is limited in how you can use (my opinion only)

    What I did was to add a date field to my table called Cur_dte. (the field does not have to physically on the form) In field rules made it a calculated field with Date() as the calc value.

    Then I bound the calendar to that field - not to the field I wanted to fill. In the event for onDateSelect I put the code to change the start_date on the form to the date selected.

    This is the code for the field on my form. You would refer to the field on your form that you are filling
    Code:
    parentform:start_date.value=date
    parentform:start_date.refresh()
    Now when you fetch a record or start a new record, the super control calendar will always be at the current date since it is bound to that calculated field cur_dte.

    As I said though I have only used it once (and it is not on a form that is used very much) but that was the only way I could see to do it - but I am sure I took the easy way out.


    You could also create a session variable (or global) on the form. Say you call it xdate ={}.

    Then in the onFetch event for the form you give it the value of xdate=date(). Now bind the calendar super control to that variable. Now when you fetch through the records the calendar control will always start at the current date. Just to play it safe I would also put the xdate=date() in the OnEnter event for new records. You would then use your code in the OnDateSelect event of the supercontrol to add the value to your form field.


    Might help (or maybe not)

    Tom
    Last edited by Tbaker; 02-19-2011, 05:09 PM. Reason: Forgot to add something

    Comment


      #3
      Re: resetting calendar supercontrol

      Mike

      Here is zip sample of a calendar control on a form (it is my testing form)

      There are two date fields on the form. The supercalendar is bound to a session variable "Xdate".

      The onFetch event for the form assigns the current date to the variable.

      Code:
      xdate=date()

      The two date fields have CanDepart event code to get the name of the active field for the supercalendar

      Code:
      dim shared fld as c
      fld=parentform.active()
      The other fields have no events attached to them however in the OnDateSelect function of the supercalendar there is an on error goto that will just end the function and assign the current date to the ptr.date so the calendar will show the current date if the date is changed while in a non date field.

      Code:
      function onDateSelect as v (date as d, ptr as p)
      	dim shared fld as c
      	on error goto stopit
      	frm_fld="parentform:"+fld+".value={"+date+"}"
      	evaluate_template(frm_fld)
      	fld=""
      	stopit:
      	ptr.date=date()
      	xdialog1.refresh()
      end function
      You can use the supercontrol calendar to change the dates in the Start_date as well as the New_date.

      Again I am sure that there are other ways of doing this - but since I was not that well versed in the super control calendar, thought I would play around with it to gain a little more knowedge

      FWIW

      Tom
      Last edited by Tbaker; 02-19-2011, 07:55 PM. Reason: Wrong Upload zip

      Comment


        #4
        Re: resetting calendar supercontrol

        Thanks Tom,
        The second method works great after a date is selected. I should have been able to figure that out. Had a day of blocking. However, it is not complete. If the month is advanced from February to March, and a new record is fetched, the calendar remains on March. I am searching for a way to have the calendar re-initialize so upon moving to a new record, the date refreshes to todays date.
        Last edited by Mike Wilson; 02-20-2011, 11:37 AM.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: resetting calendar supercontrol

          I got it. I have the supercontrol calendar bound to a session variable cal_date. To reset the calendar when a new record is selected, it is simply having the Form onFetch event resets the cal_date=date(). Too simple. Duh.
          Last edited by Mike Wilson; 02-20-2011, 12:45 PM.
          Mike W
          __________________________
          "I rebel in at least small things to express to the world that I have not completely surrendered"

          Comment


            #6
            Re: resetting calendar supercontrol

            Mike

            In my post outlining the steps I had put the the following

            The onFetch event for the form assigns the current date to the variable.

            Code:
            Code:
            xdate=date()
            Edit I see that in the sample I zipped, I commented out the line xdate=date(). I was testing that and seems that I sent the wrong zip file. Sorry about that. Glad that you got that fixed. I still feel that the supercalendar control is limited but usuable.

            Tom
            Last edited by Tbaker; 02-20-2011, 02:04 PM.

            Comment


              #7
              Re: resetting calendar supercontrol

              Tom,
              I agree that the calendar has limits, but when you find a strong way to use it, its a really nice addition.

              Thanks for your help!
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment

              Working...
              X