General discussion


Access 97 New Record problem

By MRA2 ·
I've been using the code below for about 2 years with no problem. Now I get a Run Time Error # 3021 - No Current Record

Any Ideas what happened???

***** CODE BEGINS****
Private Sub Form_Current()

Dim recClone As Recordset
Dim intNewRecord As Integer

Set recClone = Me.RecordsetClone
' But we need to check if there are no records. If so,
' we disable all the buttons except for the <New Button>

If recClone.RecordCount = 0 Then
[CMDNextDepend].Enabled = False
[Cmd Previous].Enabled = False

'Synchonise the current pointer in the two recordsets
recClone.Bookmark = Me.Bookmark

[Cmd Previous].Enabled = Not (recClone.BOF)

[CMDNextDepend].Enabled = Not (recClone.EOF)

End If

End Sub
***** CODE ENDS *****


This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by MRA2 In reply to Access 97 New Record pro ...

The strangest thing is if you place a navigation bar on the form, you can add a new record with NO PROBLEM.

Also when you get the error, if you click Exit, you can enter a new record and it works!

Collapse -

by bertonx In reply to Access 97 New Record pro ...

Maybe you can test to add some
recClone.Requery or recClone.Refresh just after the set recClone = ...

Collapse -

by MRA2 In reply to

Poster rated this answer.

Collapse -

by MRA2 In reply to Access 97 New Record pro ...

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums