Solved

acCmdFormView for datasheet

Posted on 2003-11-21
11
906 Views
Last Modified: 2007-12-19
Good morning.

Here's my problem. I have a form "frmDataEntry" that has a subform on it called "fsubCalibration". The subforms default view is datasheet, but all views are set as available in the properties.

I want to creat a button on the main form with the onclick event or a double click event on the subforms field memProcedure that runs the DoCmd.RunCommand acCmdFormView action.

Specifically I want to make it easy for the user to change the subform from datasheet to form (note: I have the start up settings locking menus and right clicks down).

Ive tried the button by settinng the focus to the subform and running the cmd.
Ive also tried getting several events to fire on the field memProcedure in the subform unsucessfully.

Anyone have any suggestions. I am sure this is pretty simply.

thanks!!!

syntnx
0
Comment
Question by:syntnx
  • 6
  • 5
11 Comments
 
LVL 3

Author Comment

by:syntnx
Comment Utility
OK nevermind, wrong cmd

Its :

DoCmd.RunCommand (acCmdSubformDatasheet)

not
acCmdFormView

syntnx
0
 
LVL 39

Accepted Solution

by:
stevbe earned 250 total points
Comment Utility
Set the focus on the subform control first ...
Make sure that you are using the name of the subform control and not the name of the subform itself.

Me.SubformControlName.SetFocus
Application.RunCommand acCmdSubformDatasheetView


Steve
0
 
LVL 3

Author Comment

by:syntnx
Comment Utility
thanks Steve, beat you to it

;)
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
did you set the focus to the subform first?
are you using the correct command?

Steve
0
 
LVL 3

Author Comment

by:syntnx
Comment Utility
have to setfocus with the button but doubleclick works without because Im already on subform

syntnx
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Author Comment

by:syntnx
Comment Utility
Steve,

Im reqrding you the points and asking CS to cancel my request to delete the post. Think it may be helpful to others in the future

thanks again

syntnx
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
did you end up using acCmdSubformDatasheet or acCmdSubformDatasheetView?
0
 
LVL 3

Author Comment

by:syntnx
Comment Utility
datasheet actually
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
After playing with this a bit I found that using acCmdSubformDatasheet is really a toggle between form and datasheet view types and acCmdSubformDatasheetView will only change it to datasheet.

Steve
0
 
LVL 3

Author Comment

by:syntnx
Comment Utility
Ahhh, thought it was strange it would change back and forth. But hey that may be better. Otherwise I would have to create a separate event or button for changing it back

Learn something new everyday!

syntnx
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
exactly what I was thinking, I am off from work today but on Monday I will be changing a couple of my standards :-)

Steve
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now