Solved No Current Record Error (1 Viewer)

InFlight

User
Local time
Tomorrow, 12:38
Joined
Jun 11, 2015
Messages
130
Hi
using access 2016

I have a sub form (Continuous Forms) and I have set

Data Entry - No
Allow Additions - No
Allow Deletions - No
Allow Edits - Yes

And have a button to add a new record which gets information based on the main form.

All fields are turned off until a new recorded is added

if there are no records and I click the add new button to add a record I get the error

"No Current Record"

I set warning false when the form opens and warning true when I close the form.

This works if I have the navigation pane open. But if it is closed I get the error
cheers
 

InFlight

User
Local time
Tomorrow, 12:38
Joined
Jun 11, 2015
Messages
130
Solved by adding this to form "On Error"

Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
    If DataErr = 3021 Then Response = 0
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:38
Joined
May 7, 2009
Messages
19,169
you should Allow Addition to Yes and Set Cancel=True on the BeforeInsert Event to prevent addition of record.
 

Users who are viewing this thread

Top Bottom