Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to open form in design view and then back in datasheet view

Status
Not open for further replies.

mlunter

MIS
Nov 15, 2005
9
US
Hello everyone and thank you for all the useful information,

I have a form that is setup to be in datasheet view. I want the information to look just like a query except I am blocking a few things from being edited. I set up the form, and when I link to it from another form it opens it up in regular form view. I have to hit design view, then normal view again in order to get the datasheet view I am looking for.

I have tried editing various properties such as disallowing form view, pivot table view, etc. and allowing datasheet view only. I also tried working code and using functions like AllowDatasheetView , but with no success. I even tried using a macro, but I couldn't get it to work. Any suggestions would be appreciated.

Thank you!
 
In the code opening this form, be sure the the second arguement is acFormDS

[tt]docmd.openform "thisform", acFormDs, ...[/tt]

Roy-Vidar
 
try

for the button or what ever your using to open the next form;

DoCmd.OpenForm "next_form", acFormDS

Steve
 
I'm sorry, but I am pretty weak with VBA (but improving). This is what I put and it didn't work:
--------------------------------------------------
Private Sub Form_Open(Cancel As Integer)

docmd.openform frmEditMonthlyForecastDataQueryView, acFormDs,

End Sub
-------------------------------------------------

I am certainly starring you guys, but more help would be appreciated.
 
In the code opening this form, means the existing code - the code which now opens the form, but having a wrong second arguement (or none). You will find that code behind the existing button somewhere on the form which calls this one. Btw - the form name goes in "quotes". The cod you have now placed in a forms on open event, must be removed.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top