GoToRecord fails

S

Steve

This code is in my subform on a "new record" contol button:

Forms!NewDict![NewDict subform]!ExamDate.SetFocus
RecCount = Me.Form.RecordsetClone.RecordCount

If RecCount > 0 Then
DoCmd.GoToRecord , , acLast
oldDx = IIf(Not IsNull([TxtDx]), TxtDx, "")
End If
Me.ExamDate.SetFocus

DoCmd.GoToRecord , , acNewRec

Forms!NewDict![NewDict subform]!ExamDate.SetFocus
Forms!NewDict![NewDict subform]!ExamDate.Value = DfltDate
Forms!NewDict![NewDict subform]!Frame67.Value = NuFu

Forms!NewDict![NewDict subform]!Provider.Value =
Forms!NewDict![DefaultProvider] '7/18/03

If RecCount > 0 Then
Me.TxtDx.Value = oldDx
End If
Me.Refresh


I get an error "you can't go to the specified record" about 50% of the
time on the acLast statement. I have no idea why this should happen.

In addition, I often don't get the acNewRec to work either, at least not
on the first try. When I click the button again, I get a new record.

Thanks for any help/ideas

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top