473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Overtime form submit and save

106 100+
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....Thanks, Richard
Nov 12 '07 #1
13 2947
NeoPa
32,556 Expert Mod 16PB
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?
Nov 12 '07 #2
Rickster66
106 100+
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
Nov 13 '07 #3
Rickster66
106 100+
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 ?
Nov 13 '07 #4
NeoPa
32,556 Expert Mod 16PB
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.
Nov 13 '07 #5
Rickster66
106 100+
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....
Nov 13 '07 #6
NeoPa
32,556 Expert Mod 16PB
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.
Nov 14 '07 #7
Rickster66
106 100+
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
Nov 14 '07 #8
Rickster66
106 100+
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....
Nov 14 '07 #9
NeoPa
32,556 Expert Mod 16PB
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
Expand|Select|Wrap|Line Numbers
  1. Field; Type; IndexInfo
  2. StudentID; Autonumber; PK
  3. Family; String; FK
  4. Name; String
  5. University; String; FK
  6. Mark; Numeric
  7. 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.
Nov 14 '07 #10
Rickster66
106 100+
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:
Expand|Select|Wrap|Line Numbers
  1. TimeSheetID
  2. Initials
  3. StartDate
  4. TimeSheetCode
  5. Week1Sunday
  6. Week1Monday
  7. Week1Tuesday
  8. Week1Wednesday
  9. Week1Thursday
  10. Week1Friday
  11. Week1Saturday
  12. Week2Sunday
  13. Week2Monday
  14. Week2Tuesday
  15. Week2Wednesday
  16. Week2Thursday
  17. Week2Friday
  18. Week2Saturday
  19. 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!!
Nov 14 '07 #11
NeoPa
32,556 Expert Mod 16PB
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).
Nov 15 '07 #12
tezza98
38
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
Expand|Select|Wrap|Line Numbers
  1.  
  2. if time1 and current time diff < 24 hours Me.txtInput.enabled = false else enabled = true
  3.  
  4. if submit flag is set for all input boxes enabled = false else enabled = true
  5.  
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
Nov 15 '07 #13
Rickster66
106 100+
Thank You so much! I finally got it !
Nov 16 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: ken | last post by:
I have a XML file as below ---------------------------------------------------------------------------------------------------------------------- <?xml version="1.0" standalone="yes"?> ...
3
by: Michele | last post by:
Hi all, I have a form with 3 combobox whitin a asp page called data.asp, whose action form is itself; the first combobox drives the behaviour of the other two. The onchange event of the first...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
20
by: Daniel Kaplan | last post by:
Hey All, In some of my pages I use a quick form to give navigational button choices, rather than links. One of them is this: <FORM name="nulltry" enctype="multipart/form-data"...
1
by: IframeLearner | last post by:
Hi , I am trying to upload a file from a parent.jsp using Iframes. From Parent page. I have to save Subject, Desc, File and file name. to upload the file i am using Iframe. I want the...
4
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.