Hi!
I have a form, that opens in Add New Record mode, using this code
For switching between the form and the datasheet view, I use this code:
This works fine, except it always goes to the first record when I switch from the form view to the datasheet view, but I'd like to stay on the current record.
How can I achieve this?
When I switch from the datasheet view to the form view, it stays on the current (selected) record.
I have a form, that opens in Add New Record mode, using this code
Code:
Private Sub Form_Load()
DoCmd.GoToRecord acDataForm, Me.name, acNewRec
End Sub
For switching between the form and the datasheet view, I use this code:
Code:
Private Sub Form_DblClick(Cancel As Integer)
'The CurrentView property uses the following settings.
'Setting Form displayed in:
'0 Design View
'1 Form View
'2 Datasheet View
'7 Layout View
If Me.CurrentView <> 2 Then
RunCommand acCmdDatasheetView
DoCmd.ShowAllRecords
Else
RunCommand acCmdFormView
End If
This works fine, except it always goes to the first record when I switch from the form view to the datasheet view, but I'd like to stay on the current record.
How can I achieve this?
When I switch from the datasheet view to the form view, it stays on the current (selected) record.