Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Load a form in datasheet view from another form

Posted on 2004-09-07
4
203 Views
Last Modified: 2012-05-07
I've got a form with a command button that I want to open a separate form in Datasheet view.  All form properties on the second form are set to datasheet specifically with an event procedure under the command button from the first form to load the second as a filtered form. If I put the code "DoCmd.RunCommand acDatasheetview" it  errors out with "datasheet view is not available" after canceling the error the form loads in the form view.  Which can be manually switched to datasheet view.  If I try a macro specifying Datasheet in the "On Load" property of the second form I get an Action Failed window which when halted opens the form in Form view?  What am I missing.
0
Comment
Question by:m_olson57
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 250 total points
ID: 12003440
Hi

you dont say what version of access you are on but this should work ok

DoCmd.OpenForm [form name], acFormDS

Just replace [form name] with the name of the form you want the command button click to open

Cheers

Scott
0
 

Author Comment

by:m_olson57
ID: 12003479
Thanks,  Access 2000.  It was the acFormDS that threw me.  I didn't try it in the correct order.  This works:

    Dim stDocName As String
    Dim stLinkCriteria As String


    stDocName = "frm_Print_Prep_1"

    stLinkCriteria = "[toc_ID]=" & Me![ID]
    DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

Thanks again!
0
 
LVL 34

Expert Comment

by:flavo
ID: 12003868
just tested

DoCmd.OpenForm "Form1", acFormDS, , "[myID] = 1"

works fine.

Are you sure the form is the right name?

Try just opening a query that is based on the same info - easier and in ds mode :-)

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 12003871
woops... now is see it worked...

Carry on..
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question