Kayleigh
Member
- Local time
- Today, 06:09
- Joined
- Sep 24, 2020
- Messages
- 706
Hi there,
Have a continuous form which shows all previous records fine. Since I don't want the new records line displayed, I have allowAdditions = false in the onCurrent event. However the command button to add a new record is always bringing up an error that it can't go to the specified record. Here is my code - what have I done wrong?
When I miss out the doCmd.GoToRecord...it opens a new record but misses the if loop.
Any suggestions?
Have a continuous form which shows all previous records fine. Since I don't want the new records line displayed, I have allowAdditions = false in the onCurrent event. However the command button to add a new record is always bringing up an error that it can't go to the specified record. Here is my code - what have I done wrong?
Code:
Private Sub cmdAddNew_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
If IsNothing(Me.fldRStaffID) Then
Me.fldRStaffID = Forms!frmLogin!cmbstaff
Me.fldRDate = Now
End If
End Sub
Any suggestions?