bfuchs
asked on
how can i change a forms view from normal to datasheet programatically?
Hi Experts,
I have a sub form that users would like to view it in both ways, meaning in datasheet view by default, but should have the option to switch to normal form view, now I am trying to avoid creating an extra form, is there a way to code this by a click of a button?
When I try running the code me.SubForm.Form.CurrentVie w=0, I get an error saying "This property is read-only and can't be set"
I have a sub form that users would like to view it in both ways, meaning in datasheet view by default, but should have the option to switch to normal form view, now I am trying to avoid creating an extra form, is there a way to code this by a click of a button?
When I try running the code me.SubForm.Form.CurrentVie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for bfuchs's comment #a40308833
for the following reason:
Never mind, I got my answer in link below, thanks for pointing me to the right direction.
https://www.experts-exchange.com/questions/23949961/Application-RunCommand-acCmdSubformFormView-Causes-Runtime-error-2501.html
Accepted answer: 0 points for bfuchs's comment #a40308833
for the following reason:
Never mind, I got my answer in link below, thanks for pointing me to the right direction.
https://www.experts-exchange.com/questions/23949961/Application-RunCommand-acCmdSubformFormView-Causes-Runtime-error-2501.html
ASKER
Never mind, I got my answer in link below, thanks for pointing me to the right direction.
ASKER
Thanks for replying,
I just got a chance to test this in my environment (access 2000), and it says "acCmdSubformFormView" this is not a defined type.
I tried the following
Open in new window
And the first part did well, however the else part (462) is giving me an error "You cancelled the previous command", any idea how to overcome this problem?
Thanks,
Ben