swell
Member
- Local time
- Today, 11:01
- Joined
- Mar 10, 2020
- Messages
- 77
Hi,
The following code works (waiting for a new record entry) when I enter it into the code window then change the form from design view to form view.
But if I close the form and then re-open, it fails and just shows the last entry (or record).
The form has a sub form showing the contents of the table.
The code sets focus to the sub form in an on Load event and selects the last record.
The main form also shows the last record in the dataset.
What is required is that the main form be ready for the entry of a new record.
I have trolled the net to find a solution.
The following code works (waiting for a new record entry) when I enter it into the code window then change the form from design view to form view.
But if I close the form and then re-open, it fails and just shows the last entry (or record).
The form has a sub form showing the contents of the table.
The code sets focus to the sub form in an on Load event and selects the last record.
The main form also shows the last record in the dataset.
What is required is that the main form be ready for the entry of a new record.
I have trolled the net to find a solution.
Code:
Private Sub Form_Open(Cancel As Integer)
'DoCmd.GoToRecord acDataForm, "Member Activity Entry", acNewRec
Me.SetFocus
DoCmd.GoToRecord , , acNewRec
' I tried same result
' DoCmd.GoToRecord acForm, Me.name, acNewRec
'
End Sub