Changing Forms CurrentView Property Using VBA
Posted on 2004-10-26
OK, have what I hope is an easy question, though I can't seem to figure out how to do it. I have an application, in which are two forms (FormA and FormB). What I would like is to have a button on FormA that, when clicked, will set the currentview of FormB to Design Mode. In other words, I want users to be able to click the button on FormA and have that button click show FormB in Design Mode. Hopefully, that's clear enough. Here is the code I am using to (unsuccessfully) accomplish this (button name is: dButton).
Private Sub dButton_Click()
Forms!FormB.CurrentView = 0 'Set FormB to Design Mode
My problem is that when the button is clicked, I get an error message stating that the CurrentView property is read-only and may not be changed. Is this true? If so, how would I accomplish the desired result?
Any and all help would be greatly appreciated. I have allocated 175 points for the answer to this rather annoying question.
As always, thank you!