B
bmersereau
I have the following Dbl click code in a form. Right now it opens the form
just fine to the first record however I would like it to open the form to a
new record. I cannot figure out what to add to the code for that to happen.
Can anyone help?
Private Sub NameID_DblClick(Cancel As Integer)
On Error GoTo Err_NameID_DblClick
Dim lngNameID As Long
If IsNull(Me![NameID]) Then
Me![NameID].Text = ""
Else
lngNameID = Me![NameID]
Me![NameID] = Null
End If
DoCmd.OpenForm "frmNames", , , , , acDialog, "GotoNew"
Me![NameID].Requery
If lngNameID <> 0 Then Me![NameID] = lngNameID
Exit_NameID_DblClick:
Exit Sub
Err_NameID_DblClick:
MsgBox Err.Description
Resume Exit_NameID_DblClick
End Sub
just fine to the first record however I would like it to open the form to a
new record. I cannot figure out what to add to the code for that to happen.
Can anyone help?
Private Sub NameID_DblClick(Cancel As Integer)
On Error GoTo Err_NameID_DblClick
Dim lngNameID As Long
If IsNull(Me![NameID]) Then
Me![NameID].Text = ""
Else
lngNameID = Me![NameID]
Me![NameID] = Null
End If
DoCmd.OpenForm "frmNames", , , , , acDialog, "GotoNew"
Me![NameID].Requery
If lngNameID <> 0 Then Me![NameID] = lngNameID
Exit_NameID_DblClick:
Exit Sub
Err_NameID_DblClick:
MsgBox Err.Description
Resume Exit_NameID_DblClick
End Sub