B
BobG
After a form record has been "Verified" as correct, I created a
DoDairy function to create a log entry in another subform on that form.
When someone edits a verified record, I create a new record in the
Diary subform to track the Field, DateofEdit, User, and any
Comments about the change in the Diary subform.
One field (Speed) has this in the AfterUpdate event.
=DoDiary([Screen].[ActiveControl].[Name])
Public Sub DoDiary(CallingControl As String) ' *** DO DIARY ****
Dim GetComments As String
If Not IsNull(Forms![frmMachineAdjustments]![VerifyDate]) Then
Forms![frmMachineAdjustments]![frmMachineAdjustmentsDiary].SetFocus
DoCmd.GoToRecord , , acNewRec
Forms![frmMachAdj]![frmMachAdjDiary].Form![Field] = CallingControl
Forms![frmMachAdj]![frmMachAdjDiary].Form![DateofEdit] = Now()
Forms![frmMachAdj]![frmMachAdjDiary].Form![User] = CurrentUser
Prompt = "Updating " & CallingControl & vbcrlf & "Please Enter
Comments"
Title = "Editing A Verified Record"
GetComments = InputBox(Prompt, Title)
Forms![frmMachineAdj]![frmMachAdjDiary].Form![Comments] =
GetComments
DoCmd.GoToControl CallingControl
End If
End Sub
My problem is that the whole function runs twice!
One record fills out properly, but it repeats one more time.
* If I remove the InputBox portion of the code, the remaining
fields are updated only once.
What's wrong with my InputBox code?
Any assistance would be appreciated.
DoDairy function to create a log entry in another subform on that form.
When someone edits a verified record, I create a new record in the
Diary subform to track the Field, DateofEdit, User, and any
Comments about the change in the Diary subform.
One field (Speed) has this in the AfterUpdate event.
=DoDiary([Screen].[ActiveControl].[Name])
Public Sub DoDiary(CallingControl As String) ' *** DO DIARY ****
Dim GetComments As String
If Not IsNull(Forms![frmMachineAdjustments]![VerifyDate]) Then
Forms![frmMachineAdjustments]![frmMachineAdjustmentsDiary].SetFocus
DoCmd.GoToRecord , , acNewRec
Forms![frmMachAdj]![frmMachAdjDiary].Form![Field] = CallingControl
Forms![frmMachAdj]![frmMachAdjDiary].Form![DateofEdit] = Now()
Forms![frmMachAdj]![frmMachAdjDiary].Form![User] = CurrentUser
Prompt = "Updating " & CallingControl & vbcrlf & "Please Enter
Comments"
Title = "Editing A Verified Record"
GetComments = InputBox(Prompt, Title)
Forms![frmMachineAdj]![frmMachAdjDiary].Form![Comments] =
GetComments
DoCmd.GoToControl CallingControl
End If
End Sub
My problem is that the whole function runs twice!
One record fills out properly, but it repeats one more time.
* If I remove the InputBox portion of the code, the remaining
fields are updated only once.
What's wrong with my InputBox code?
Any assistance would be appreciated.