Here's the code for the entire module. the Main form is frmRNnotes, the
source list box is lstRNnotes, and the target form is fsubRNnotes. Funky I
know.
Option Compare Database
Option Explicit
**********************************************************
Private Sub cmdRNnotesEdit_Click()
On Error GoTo cmdRNnotesEdit_Click_Error
Me.Form.AllowEdits = True
Me.lstRNnotesLU.Locked = False
Me.fsubRNnotes.Locked = False
Me.fsubRNnotes.Form.AllowDeletions = True
On Error GoTo 0
Exit Sub
cmdRNnotesEdit_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdRNnotesEdit_Click of VBA Document Form_frmRNnotes"
End Sub
**********************************************
Private Sub Form_AfterInsert()
On Error GoTo Form_AfterInsert_Error
Me.Requery
On Error GoTo 0
Exit Sub
Form_AfterInsert_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_AfterInsert of VBA Document Form_frmRNnotes"
End Sub
************************************************************
Private Sub Form_Current()
On Error GoTo Form_Current_Error
DoCmd.GoToRecord , , acNewRec
On Error GoTo 0
Exit Sub
Form_Current_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_Current of VBA Document Form_frmRNnotes"
End Sub
************************************************************
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Form_Open_Error
Me.Form.AllowEdits = False
Me.lstRNnotesLU.Locked = True
Me.fsubRNnotes.Locked = True
Me.fsubRNnotes.Form.AllowDeletions = False
On Error GoTo 0
Exit Sub
Form_Open_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Form_Open of VBA Document Form_frmRNnotes"
End Sub
************************************************************
Private Sub lstRNnotesLU_DblClick(Cancel As Integer)
On Error GoTo lstRNnotesLU_DblClick_Error
Me.Refresh
On Error GoTo 0
Exit Sub
lstRNnotesLU_DblClick_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
lstRNnotesLU_DblClick of VBA Document Form_frmRNnotes"
End Sub
************************************************************
Private Sub cmdRNnotesClose_Click()
On Error GoTo Err_cmdRNnotesClose_Click
DoCmd.Close
Exit_cmdRNnotesClose_Click:
Exit Sub
Err_cmdRNnotesClose_Click:
MsgBox Err.Description
Resume Exit_cmdRNnotesClose_Click
End Sub
Private Sub cmdRNnotesRptOpen_Click()
On Error GoTo Err_cmdRNnotesRptOpen_Click
Dim stDocName As String
stDocName = "rptCaseReport"
DoCmd.OpenReport stDocName, acPreview
Exit_cmdRNnotesRptOpen_Click:
Exit Sub
Err_cmdRNnotesRptOpen_Click:
MsgBox Err.Description
Resume Exit_cmdRNnotesRptOpen_Click
End Sub
************************************************************
I personally think it's very dangerous to use a form's Current event to move
the form to a new record, which then triggers the Current event again, which
moves the form to a new record, which triggers the Current event again,
which moves the form to a new record, and so on. (This may be part of why
you're not seeing the record stored?) Plus, any time you make a record
current, the form will immediately move to a new record, which will prevent
you from editing data in that one record.
I'd be inclined to use the listbox's event procedure to move to the new
record, not the form's current event. And, if you want the record to
"stick", you might want to actually write a value into a bound control in
that record, which will cause the default value to be put into that
CurrentUser control. Or better, use the code to write the result of
CurrentUser() function into the textbox and forgo the use of the textbox's
Default Value property entirely.

Signature
Ken Snell
<MS ACCESS MVP>
> Here's the code for the entire module. the Main form is frmRNnotes, the
> source list box is lstRNnotes, and the target form is fsubRNnotes. Funky I
[quoted text clipped - 186 lines]
>> >> >
>> >> > Rob
RobUCSD - 31 May 2007 02:35 GMT
Ken, Thanks for your patience. Could you explain or give me an example of
the following, Thanks Rob
> I personally think it's very dangerous to use a form's Current event to move
> the form to a new record, which then triggers the Current event again, which
[quoted text clipped - 201 lines]
> >> >> >
> >> >> > Rob
RobUCSD - 31 May 2007 03:11 GMT
Here's the rest of the previous "if you want the record to
> "stick", you might want to actually write a value into a bound control in
> that record, which will cause the default value to be put into that
> CurrentUser control. Or better, use the code to write the result of
> CurrentUser() function into the textbox and forgo the use of the textbox's
> Default Value property entirely.
> Ken, Thanks for your patience. Could you explain or give me an example of
> the following, Thanks Rob
[quoted text clipped - 204 lines]
> > >> >> >
> > >> >> > Rob
Ken Snell (MVP) - 01 Jun 2007 05:15 GMT
I've made small change to your listbox's DoubleClick event procedure:
Private Sub lstRNnotesLU_DblClick(Cancel As Integer)
On Error GoTo lstRNnotesLU_DblClick_Error
Me.Refresh
' This adds new record
Me.Recordset.AddNew
' This dirties the record by writing the CurrentUser value into the
appropriate field
Me.NameOfUserField.Value = CurrentUser()
On Error GoTo 0
Exit Sub
lstRNnotesLU_DblClick_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
lstRNnotesLU_DblClick of VBA Document Form_frmRNnotes"
End Sub

Signature
Ken Snell
<MS ACCESS MVP>
> Ken, Thanks for your patience. Could you explain or give me an example of
> the following, Thanks Rob
[quoted text clipped - 225 lines]
>> >> >> >
>> >> >> > Rob