If Not Me.NewRecord Then
If Me.Child124.Form.Recordset.RecordCount = 0 Then
Me.PrimaryLinkBtn.Enabled = False
Else
Me.PrimaryLinkBtn.Enabled = True
End If
End If
/gustav
filtrationproducts
ASKER
Gustav,
I tried that but unfortunately I still receive the "no current record" error when exiting. I read somewhere this had something to do with the "recordcount" command.
I am also confused as to why it errors when I close the form. I would think I would get the error right away when navigating to the new record.
But I know it has to be this line of code because when I comment it out/delete it I do not receive the errors anymore.
Dan
Gustav Brock
But if you really are on a new record, the code will be skipped.
So, I guess, something else is going on.
Or rewrite your code. There should be no reason to enable/disable controls when you close the form.
It was bypassing the code when I was on a new record, I setup a msgbox to make sure. But for some mysterious reason I would still get the error message. I think it had something to do with using that "recordset.recordcount" command at any point when the form is open. Because once that line of code ran (when I navigated through records) then exited the form on a New record it would error.
If Not Me.NewRecord Then
If Me.Child124.Form.Recordset
Me.PrimaryLinkBtn.Enabled = False
Else
Me.PrimaryLinkBtn.Enabled = True
End If
End If
/gustav