Gina,
Firat of all thank you so much for all of your time and expertise!
Here is the code.
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
Select Case Me.Frame10
Case Is = 0
MsgBox "Please Choose a Valid Option"
Cancel = True
End Select
End Sub
Private Sub Form_Current()
Me.AllowEdits = Me.NewRecord
End Sub
Private Sub Form_Dirty(Cancel As Integer)
Me.Parent![Date Worked].Value = Me.DateofComment.Value
End Sub
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
'Me.Dirty = False
End Sub
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
:
Bunky,
And you say nothig happens when they click in the frame of the
subform?
Please copy/paste the rest of 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
The code is on the subform in the ON Dirty event.
Private Sub Form_Dirty(Cancel As Integer)
Me.Parent![Date Worked].Value = Me.DateofComment.Value
End Sub
:
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
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?
:
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
No Problem, but it still does not work the way I want it to.
Ideas?
:
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
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.
:
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
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?