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

Requesting Chanuka Gift (can someone write this script)?

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

    Requesting Chanuka Gift (can someone write this script)?

    Appointment_range.png

    Im trying to create a calendar and I need a script to populate a table with appointment records, based on presenting the user with the above dialog. The table is Appointments and 3 fields need to be assigned values.

    Appt_ID is an auto increment field (Numerical)
    Appt_Date
    Appt_Time (shorttime)

    At the end of the script the user should know it has been completed. Also the user must be prevented from adding appointment records to a day that has existing appointment records.

    example of some filled records would be:

    1 12/01/2012 9:00 am
    2 12/01/2012 9:15 am
    3 12/01/2012 9:30 am

    Im trying to learn xbasic but I know at this point Im not capable of doing this.

    Thanks
    Barry

    #2
    Re: Requesting Chanuka Gift (can someone write this script)?

    Barry
    Your explanation is very scant. Is there anything the calendar must go on to do, and how should it look.
    Also - "the user must be prevented from booking another appointment on the same day", you give examples of three appointments on the same day.
    What you seem to want is probably not difficult but unless something different is required cant you just use a freeware calendar? If you explain more it would help.

    Comment


      #3
      Re: Requesting Chanuka Gift (can someone write this script)?

      Hi Ray,
      Im not concerned yet with the look of the calendar, but all I really need is a day view. I will create an embedded browse and limit the records to only one day. What I mean by not allowing the user to create existing appointment records is this. If I have previously used this dialog and created the the records for the month of March 2012 I don't want the user to be able to do it again. The appointment table will of course contain other fields, but that has nothing to do with this script.

      Comment


        #4
        Re: Requesting Chanuka Gift (can someone write this script)?

        The only way I can think of to do what you suggest is to add a logical field to the table. When the user is through entering records for a particular day, an update operation/script is run that sets the logical field for all records for that day to true (false is the default - no value set).

        You would have a short script for the table's cansaverecord event in the field rules. The script would check if there were records for the current day with the logical field set to true and if found the cansaverecord event would be cancelled.
        There can be only one.

        Comment


          #5
          Re: Requesting Chanuka Gift (can someone write this script)?

          Hi,
          I have a feeling that I'm still not making this clear enough. The purpose of the above dialog is to pre populate a series of days (more likely a complete year) with empty appointment records (other than the ID, Date, and Time fields).

          For instance If I specify a date range of 1 week with a start time of 9AM, and an end time of 5PM, with 30 min intervals. The script should create 7 days of records with 16 records per day.

          Now lets say I have run the script and created all the appointment records for the year 2012. I want to make sure that I cant run the script again and create the same records again for the year 2012 . In other words If a day of appointments has already been created the script should end with an error message letting me know that appointment records already exist for that date range.

          Once the records have been created and Im actually using the calendar, the calendar form that I will design will only allow for the modification of the existing records, and will restrict both creation and deletion of records.

          Thanks

          Comment


            #6
            Re: Requesting Chanuka Gift (can someone write this script)?

            I have done something like this. I'm trying to remember the methodology that I used. I don't think I literally compared for the existence of records but rather had a second table w. a start and end date in each record that was used to seed the first table as you want to do. If a new date fell within the range of a previous record, the operation didn't proceed. If I can remember where I did this, I'll report back. But I think it was something like this:


            "Seed" table:

            1. 1/1/11 - 12/31/11
            2. 1/1/12 - 2/28/12
            etc

            "Calendar" table:
            1/2/11
            1/2/11
            1/3/11
            ...
            12/31/11
            1/1/12
            ...
            2/28/12

            So if the user created a new date range in the "seed" table and one or more of the dates was in the previous date range records, the script wouldn't create the duplicate calendar records. I think that's what I did. Just don't remember exactly.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: Requesting Chanuka Gift (can someone write this script)?

              It was even simpler that that. There was nothing to prevent the user from entering a duplicate date range. Common sense dictated that they wouldn't. But once the script ran for a given date range a logical field was set to .T. so that the user couldn't run that same range again. In your case you could make it simpler and bullet proof it by just using a year field and set the field rule to "unique". Then they couldn't dupe the same year. Use the logical the same way i did so they don't run the script for a given year twice. If I find what I did I'll post the code for you. It was quite simple, nothing elaborate. Yours may be slightly more complex where you want time periods for each day.
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                Re: Requesting Chanuka Gift (can someone write this script)?

                Hi Peter,
                If a Time field was added to the table (that stored date and time) and that was set to unique only in the field rules. Would that prevent the script from creating duplicate records?

                Comment


                  #9
                  Re: Requesting Chanuka Gift (can someone write this script)?

                  Originally posted by barry685 View Post
                  Hi Peter,
                  If a Time field was added to the table (that stored date and time) and that was set to unique only in the field rules. Would that prevent the script from creating duplicate records?
                  If you made an expression in your field rule validations, so "Uniqueness test" = "validation of expression must be unique" and the set the "unique expression" to something like cdate(date)+time() where date & time are the name of your fields.
                  Peter
                  AlphaBase Solutions, LLC

                  [email protected]
                  https://www.alphabasesolutions.com


                  Comment


                    #10
                    Re: Requesting Chanuka Gift (can someone write this script)?

                    I think I misunderstood. Wouldn't a query on the table be sufficient to test if records for the date range exist? If they don't proceed, if they do pop up a warning box and end the script.
                    Last edited by MoGrace; 12-26-2011, 06:03 PM.
                    Robin

                    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                    Comment


                      #11
                      Re: Requesting Chanuka Gift (can someone write this script)?

                      happy chanuka Barry, I await my chanuka gift
                      Attached, a working calendar as per your specs;- the settings and button to populate slots for the coming day/s appears only when viewing a blank day
                      This should be sufficient to prevent duplication unless you really try.

                      Just open the form "DayView" - well its actually the only form, look at the top of the list. You must widen the form - I didnt save resize after the last changes

                      Maybe someone can help - a small detail that I can't resolve,'=|

                      when you type in a date it accepts but selecting off the pop up calendar the date variable doesn't change.
                      Attached Files
                      Last edited by Ray in Capetown; 12-26-2011, 09:01 PM.

                      Comment


                        #12
                        Re: Requesting Chanuka Gift (can someone write this script)?

                        Hi Ray,
                        Thanks alot Its almost good
                        There seems to be a bug that regardless of what parameters I type in and I am entering 2 slots and 1 day, It keeps on creating records based on your defaults of 4 slots and 5 days.

                        Comment


                          #13
                          Re: Requesting Chanuka Gift (can someone write this script)?

                          Ray,
                          If you want the form to stay open to the size you specify. Go into Form properties, Window Tab, and set the Size Width and Height to "Use form width" in the drop down.
                          Barry

                          Comment


                            #14
                            Re: Requesting Chanuka Gift (can someone write this script)?

                            Hi Ray,
                            Found another problem After days are created when I change the starting date to another date to create new records I get the following error message;error_calendar.png

                            However after the error message it still creates the days.

                            Comment


                              #15
                              Re: Requesting Chanuka Gift (can someone write this script)?

                              Here is a readied and tested version
                              Attached Files

                              Comment

                              Working...
                              X