Changing subform to datasheet view

K

kiln

I have an Access 2000 parent form with a subform control. I need to be
able to switch the subform between form view and datasheet. But I can't
get the basic actions to work. If I use either

subForm.SetFocus
RunCommand acCmdDatasheetView
or
subForm.SetFocus
subForm!VersionID.SetFocus
RunCommand acCmdDatasheetView

the main form, the one hosting the subform control, goes into
datasheet. That's not supposed to be happening. Code is running from the
main form. If I try to use RunCommand acCmdDatasheetView from inside the
subform, I get error 2174: You can't switch to a different view at this
time, code is executing etc.

What's the deal with this?
 

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