If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Refreshing Question
I have a mainform with two subforms, all driven by different tables. On the
one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#2
|
|||
|
|||
Refreshing Question
Bunky,
Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#3
|
|||
|
|||
Refreshing Question
Gina,
I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#4
|
|||
|
|||
Refreshing Question
On Wed, 2 Sep 2009 07:38:01 -0700, Bunky
wrote: I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! Put a line Me.Dirty = False immediately before the End Sub to force an immediate save. Note that this will cause problems if you have any Required fields which have not yet been filled in. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Refreshing Question
Hi John,
I tried the code you suggested on both the 'ON Click' Event and the 'After Update' event and neither did what I want to happen. Ideas? "John W. Vinson" wrote: On Wed, 2 Sep 2009 07:38:01 -0700, Bunky wrote: I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! Put a line Me.Dirty = False immediately before the End Sub to force an immediate save. Note that this will cause problems if you have any Required fields which have not yet been filled in. -- John W. Vinson [MVP] |
#6
|
|||
|
|||
Refreshing Question
Bunky,
I did not mean to move the entire code, my fault for not saying so.... just this line... Me.Parent![Date Worked].Value = Me.DateofComment.Value -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#7
|
|||
|
|||
Refreshing Question
No Problem, but it still does not work the way I want it to.
Ideas? "Gina Whipp" wrote: Bunky, I did not mean to move the entire code, my fault for not saying so.... just this line... Me.Parent![Date Worked].Value = Me.DateofComment.Value -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#8
|
|||
|
|||
Refreshing Question
Bunky,
Perhaps the way you want it to work will require putting that on the On_Dirty of the form? That way any time anything on that form is changed the date will update? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... No Problem, but it still does not work the way I want it to. Ideas? "Gina Whipp" wrote: Bunky, I did not mean to move the entire code, my fault for not saying so.... just this line... Me.Parent![Date Worked].Value = Me.DateofComment.Value -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#9
|
|||
|
|||
Refreshing Question
Gina,
Still no luck but I noticed something. On my subform, I placed an 'Undo' button to undo changes if they catch the error prior to the update. If I click on the undo button, the date/time refreshes. The code on the undo is simply this: Private Sub Undo_Record_Click() On Error GoTo Err_Undo_Record_Click DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 Me.Parent!Results.Value = Null Exit_Undo_Record_Click: Exit Sub Err_Undo_Record_Click: MsgBox Err.Description Resume Exit_Undo_Record_Click End Sub Ideas? "Gina Whipp" wrote: Bunky, Perhaps the way you want it to work will require putting that on the On_Dirty of the form? That way any time anything on that form is changed the date will update? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... No Problem, but it still does not work the way I want it to. Ideas? "Gina Whipp" wrote: Bunky, I did not mean to move the entire code, my fault for not saying so.... just this line... Me.Parent![Date Worked].Value = Me.DateofComment.Value -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
#10
|
|||
|
|||
Refreshing Question
Bunky,
Is this code you entered on the form or the subform? Because it should be in the Form_Dristy event of the subform. If it is then please copy/paste the code behind the subform. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, Still no luck but I noticed something. On my subform, I placed an 'Undo' button to undo changes if they catch the error prior to the update. If I click on the undo button, the date/time refreshes. The code on the undo is simply this: Private Sub Undo_Record_Click() On Error GoTo Err_Undo_Record_Click DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 Me.Parent!Results.Value = Null Exit_Undo_Record_Click: Exit Sub Err_Undo_Record_Click: MsgBox Err.Description Resume Exit_Undo_Record_Click End Sub Ideas? "Gina Whipp" wrote: Bunky, Perhaps the way you want it to work will require putting that on the On_Dirty of the form? That way any time anything on that form is changed the date will update? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... No Problem, but it still does not work the way I want it to. Ideas? "Gina Whipp" wrote: Bunky, I did not mean to move the entire code, my fault for not saying so.... just this line... Me.Parent![Date Worked].Value = Me.DateofComment.Value -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... Gina, I put all the coding in the After Update but it did the same thing which is not changing the date / Time when different selections are clicked. The reason is not really for the breaks but for lunchs. Our operators are on the phone to our owners and we tell them the exact date and time we did something for them. Believe me the owners will correct you if you are an hour off. "Gina Whipp" wrote: Bunky, Try using the After Update event of the Frame, though I am still unclear why you want to do it this way because that 15 minutes could be just the Operator confirming something prior to reselecting. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Bunky" wrote in message ... I have a mainform with two subforms, all driven by different tables. On the one subform, when the operation clicks an option (there are 17 of them), I have code running behind it to populate different fields one of which is the Comment Date and Time field. The problem is if the operator is in the middle of entering an option and then goes on break. When, they come back, the time is 15 minutes off the actual time the operator did the work. Here is the code. Private Sub Frame10_Click() Me.Splst.Value = fOSUserName() Me.Parent!Specialist.Value = fOSUserName() Me.Parent![Date Worked].Value = Me.DateofComment.Value Me.OptionChosen = Me.Frame10.Value Me.Parent!Results.Value = Me.Frame10.Value End Sub I thought if they just re-clicked another option and then clicked the first option chosen, it would update the time but it does not. How can I force a new time each time an option is clicked? Ideas are always welcome! |
Thread Tools | |
Display Modes | |
|
|