Solved

acCmdFormView for datasheet

Posted on 2003-11-21
11
909 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
ID: 9796596
OK nevermind, wrong cmd

Its :

DoCmd.RunCommand (acCmdSubformDatasheet)

not
acCmdFormView

syntnx
0
 
LVL 39

Accepted Solution

by:
stevbe earned 250 total points
ID: 9796656
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
ID: 9796672
thanks Steve, beat you to it

;)
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 39

Expert Comment

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

Steve
0
 
LVL 3

Author Comment

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

syntnx
0
 
LVL 3

Author Comment

by:syntnx
ID: 9796823
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
ID: 9796906
did you end up using acCmdSubformDatasheet or acCmdSubformDatasheetView?
0
 
LVL 3

Author Comment

by:syntnx
ID: 9797091
datasheet actually
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9797683
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
ID: 9797745
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
ID: 9797758
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

810 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