Code Fails in Module but Works in Immediate

D

David Habercom

I cannot understand why this code fails at DoCmd ("Can't
go to specified record.") but works properly when I step
through and run Me.RListSubform.SetFocus in the Immediate
Window. Why would SetFocus not work in the module?

....
Select Case AddDelOptGrp
Case 1 'Add
Me.RListSubform.Height = Me.RListSubform.Height + 235
Me.RListSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
Case 2 'Delete
...

Thanks.
 

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