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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form in datasheet view 1

Status
Not open for further replies.

dday01

Technical User
Feb 1, 2002
138
0
0
US
Hi All,

I have a a form that has some general agency info on it. I have a button on that form that opens a subform that contains crosstab data based on a query. If I open the subform seperately it opens in datasheet view the way it is supposed to. However when I open the form from the button on the main form it opens in form view (I don't know why this is happening, I have the default view for the subform set to Data sheet). Can any one help me with this? do I need some extra code on the open form event? I'm quite frustrated at this point. Thanks in advance.

D
 
Hi Omega,

Yes, i did set views allowed to datasheet as well.

D
 
Have you tried something like this ?
DoCmd.OpenForm FormName, acFormDS

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya dday01 . . . . .

The problem is Form/Datasheet views are directly tied to the View Menu and setting Default to Datasheet View just doesn't work as it should.

So in the [blue]Open Event[/blue] of your subform, add the following line:
[purple]docmd.RunCommand acCmdDatasheetView[/purple]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top