Link to home
Start Free TrialLog in
Avatar of ajslentz
ajslentz

asked on

Problem with form opening from onclick

I have a form that has a button and when I click on it the form opens but it's in form view.  I need it in datasheet view.

I've set the default to data sheet and even changed the settings for form view isn't available.  Any ideas why this thing keeps opening in form view?  Below is a way that another guy explained it...

"Won't open form in Data Sheet View - Access does not seem to allow you to open a form in Data Sheet View from within another form (in Form View) via a button - even though Data Sheet view is specified as Default in the properties of the form itself.  I have even tried to remove the "Form View" from the properties ("Allow Form View - "NO"") window - this has no effect when opening form from within another form.  Even from a switchboard it opens the form in "FORM" view not data sheet view.  You can switch the view on the form to Data Sheet once open but it will not open in Data Sheet view as a default"

So, the bottom line is why in the world won't the form open in datasheet view when we open it with a button.  When we open it from the access "console" (in the forms part) it opens in datasheet view every time.

Thanks,
Avatar of rockiroads
rockiroads
Flag of United States of America image

u can specify the open in datasheet view when u open the form using

DoCmd.OpenForm

ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wellesleydpw
wellesleydpw

I just had the same issue a found another solution.
1. Right-click the button that opens the form and select "Build Event".
2. On the Action "OpenForm" and under the Action Arguments change the View from "Form" to "Datasheet"