Overtime form submit and save

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rickster66
    New Member
    • Sep 2007
    • 106

    #1

    Overtime form submit and save

    Hello Everyone,

    I have been asked to create a form in Ms Access that allows employees to signup for overtime. I created a form that goes by 2 week periods at a time. Now I have been asked to add functionality that allows the user to enter the date then save it. When the save is done, the user is able to change the hours entered at will. This is to be allowed up until 24 hours of the actual shift. In this case, No changes are allowed. Also, a submit button has been added. When it is pressed, no changes are allowed either. I have been struggling on how to make the submit function happen with the feature that allows shift chages up till 24 hours before the shift. Any help is greatly appreciated. I am desperate....Th anks, Richard
    Last edited by Rickster66; Nov 12 '07, 07:48 PM. Reason: need to add MS Access
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I would think that the "Submit" button would have to update a flag somewhere.
    The BeforeUpdate Event Procedures of the controls on the form would check check the current Date / Time and compare it with the Date / Time of the item being updated. If it is less than 24 hours before, then Cancel is set to true. Otherwise, the flag updated by the commit is checked. If that is TRUE then Cancel is also set to TRUE. If neither of these conditions are met then the update proceeds.
    Does that help?

    Comment

    • Rickster66
      New Member
      • Sep 2007
      • 106

      #3
      I have an idea but it still is not very clear to me. The submit class a before update function where the two dates are conpared? how would cancel be implemented? Thanks, Richard

      Comment

      • Rickster66
        New Member
        • Sep 2007
        • 106

        #4
        My wrong, I mean the submit calls the function, how could i implement the save button so that the users can change their hours as needed ?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          Originally posted by Rickster66
          My wrong, I mean the submit calls the function, how could i implement the save button so that the users can change their hours as needed ?
          I deleted your other thread. It was a duplicate of this one.

          As to your last comments - either I'm up too late or it doesn't make sense. Bear in mind I only know what you've told me and you haven't given me much to go on. How about you explain what you mean a little clearer and I'll look at it afresh tomorrow.

          Comment

          • Rickster66
            New Member
            • Sep 2007
            • 106

            #6
            No problem, what I have is a form with three button and 13 textboxes which indicate a specific dates, below the textboxes is another set where the user can enter the hours he or she will be signing up for. The save button will allow the user to save the information entered but not permanently. The submitbutton makes the entry permanent. The stipulation is that entries can be changed up until 24 hours of the actual date only. For example, if I signup up for overtime for today tuesday, tomorrow and thursday, I will be able to make changes to my entry for thursday but not tomorrow....... I'm not sure how to go about all this....

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32669

              #7
              Now I'm really confused.
              I thought I'd basically answered this. If you don't follow what I'm saying then say so - that I can understand. You just seem to have started again, rephrasing the same question so I don't know what you do or do not understand. My only option is to repeat what I've already said as you've provided no feedback and unfortunately I'm not a mind-reader. This will obviously not get us anywhere.

              Please respond to what I post.

              Comment

              • Rickster66
                New Member
                • Sep 2007
                • 106

                #8
                I didn't mean to confuse you. What I meant to say is that I don't know how to set up 2 buttons: a save button that allows users to make changes up until 24 hours of the actual shift, after which, changes should not be allowed. Another is a submit button that does not allow change whatsover once it is click. Once again, sorry for the confusion.

                Richard

                Comment

                • Rickster66
                  New Member
                  • Sep 2007
                  • 106

                  #9
                  I now understand the idea of how beforeupdate can do in my project. My question now is since the updates are made 2 weeks at a time, how can use beforeupdate to check for each particular day? In other words, everytime save is click the entire set of 13 days is updated. I am lost....

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32669

                    #10
                    Richard, your last post seems to be a response to my suggested help :)
                    However, oblique references to items I have no detailed knowledge of leave me still unable to help. What I suggest you do is post some table meta-data. That is some of the detail I need even to envisage clearly what your problem is. I know it's a lot more detail than most people are used to dealing with, but without it (and of course without direct access to what you can see and understand quite easily as you have the db in front of you) it's very hard to understand the problem well enough to be of any help.
                    Here is an example of how to post table MetaData :
                    Table Name=tblStudent
                    Code:
                    [i]Field; Type; IndexInfo[/i]
                    StudentID; Autonumber; PK
                    Family; String; FK
                    Name; String
                    University; String; FK
                    Mark; Numeric
                    LastAttendance; Date/Time
                    To get the codes you need to lay it out correctly, copy it from the quote of my post after clicking on the reply button.
                    With this format you can explain how your tables are set up at least. That will be a good starting point. Not all questions need so much detail but for a question of any complexity it is so important.
                    Believe me - finding a solution is rarely as much of a problem when working via a web site as just understanding the question.

                    Comment

                    • Rickster66
                      New Member
                      • Sep 2007
                      • 106

                      #11
                      I am not very clear as to how to make the metadata table for me. What I have is a table that looks like this:
                      Code:
                      TimeSheetID
                      Initials
                      StartDate
                      TimeSheetCode
                      Week1Sunday
                      Week1Monday
                      Week1Tuesday
                      Week1Wednesday
                      Week1Thursday
                      Week1Friday
                      Week1Saturday
                      Week2Sunday
                      Week2Monday
                      Week2Tuesday
                      Week2Wednesday
                      Week2Thursday
                      Week2Friday
                      Week2Saturday
                      Notes
                      The update(save) so far, is made at one time for the entire row (from Week1Sunday to Week2Saturday) . I'm not clear as to how to go about using a metatable in order to apply the rule that a field value that is less than 24 hours than the actual date will not be updated. I will happily provide you with more info. Thank you very much!!

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32669

                        #12
                        I could do with the name of the table (I assume the form works directly off this table rather than via a query) and the types of all the fields (The example was put in to help you provide all the same data).

                        However, I did manage to have a look at the layout and it wasn't clear to me how this is used. Maybe the field types may give further help here, but some example data may also point me in the right direction. Particularly some indication of how any dates fit into the picture. What is Week1 relative to for instance?

                        BTW Meta Data is nothing too magical. It's simply the way of describing the structure of the table (which and what type of fields it has etc).

                        Comment

                        • tezza98
                          New Member
                          • Mar 2007
                          • 38

                          #13
                          If I get the jist of what you want - a user enters the dates and saves them, he can then change the dates up untill 24 hours, which they are then locked, the submit button locks the date permantly?

                          On your form where the users enter their date i would write some vb code for the textboxes of each date, to compare the current date with their date, and lock that textbox if it is less then 24 hours.

                          pseudocode cos im lazy
                          Code:
                           
                          if time1 and current time diff < 24 hours Me.txtInput.enabled = false else enabled = true
                          
                          if submit flag is set for all input boxes enabled = false else enabled = true
                          for the submit button, add a boolean field to the table, and set it to yes once the user has submitted, then on the form lock all the inputs for that user, since it is permantly saved

                          Comment

                          • Rickster66
                            New Member
                            • Sep 2007
                            • 106

                            #14
                            Thank You so much! I finally got it !

                            Comment

                            Working...