Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Load a form in datasheet view from another form

Posted on 2004-09-07
4
Medium Priority
?
219 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
[X]
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
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 1000 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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

688 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